Don't make handleStatus directly emit an event

This commit is contained in:
Christian Muehlhaeuser 2019-05-05 18:17:59 +02:00
parent 5f1d54421b
commit c3cc78dc67
No known key found for this signature in database
GPG key ID: 3CF9FA45CA1EBB7E

View file

@ -251,7 +251,7 @@ func (mod *Account) handleNotification(n *mastodon.Notification) {
mod.evchan <- ev
}
func (mod *Account) handleStatus(s *mastodon.Status) {
func (mod *Account) handleStatus(s *mastodon.Status) accounts.MessageEvent {
ev := accounts.MessageEvent{
Account: "mastodon",
Name: "post",
@ -286,7 +286,7 @@ func (mod *Account) handleStatus(s *mastodon.Status) {
ev.Post.ActorName = s.Account.Username
}
mod.evchan <- ev
return ev
}
func (mod *Account) handleStreamEvent(item interface{}) {
@ -298,7 +298,7 @@ func (mod *Account) handleStreamEvent(item interface{}) {
mod.handleNotification(e.Notification)
case *mastodon.UpdateEvent:
mod.handleStatus(e.Status)
mod.evchan <- mod.handleStatus(e.Status)
}
}