Use new event API

This commit is contained in:
2021-11-20 20:52:08 +09:00
parent df5f0c0f65
commit 9368689019
8 changed files with 38 additions and 50 deletions

View File

@ -10,7 +10,7 @@ import (
"sync"
"time"
"github.com/aerogo/aero"
"github.com/aerogo/aero/event"
"github.com/aerogo/http/client"
"github.com/animenotifier/ffxiv"
"github.com/animenotifier/notify.moe/arn/autocorrect"
@ -61,7 +61,7 @@ type User struct {
eventStreams struct {
sync.Mutex
value []*aero.EventStream
value []*event.Stream
}
}
@ -219,10 +219,8 @@ func (user *User) SendNotification(pushNotification *PushNotification) {
// }
// Send an event to the user's open tabs
user.BroadcastEvent(&aero.Event{
Name: "notificationCount",
Data: userNotifications.CountUnseen(),
})
notificationCount := event.New("notificationCount", userNotifications.CountUnseen())
user.BroadcastEvent(notificationCount)
}
// RealName returns the real name of the user.