Improved activity page

This commit is contained in:
2021-11-23 15:47:25 +09:00
parent 1cf4e6a1ae
commit 0f5f18db0c
12 changed files with 113 additions and 32 deletions

View File

@ -6,6 +6,7 @@ import (
"reflect"
"github.com/aerogo/aero"
"github.com/aerogo/aero/event"
"github.com/aerogo/api"
"github.com/aerogo/markdown"
"github.com/animenotifier/notify.moe/arn/autocorrect"
@ -120,6 +121,12 @@ func (thread *Thread) Create(ctx aero.Context) error {
activity := NewActivityCreate("Thread", thread.ID, user.ID)
activity.Save()
// Broadcast event to all users so they can reload the activity page if needed
for receiver := range StreamUsers() {
activityEvent := event.New("post activity", receiver.IsFollowing(user.ID))
receiver.BroadcastEvent(activityEvent)
}
return nil
}