From c3cc78dc671031ca17999626813e1c3cd7cc11ee Mon Sep 17 00:00:00 2001 From: Christian Muehlhaeuser Date: Sun, 5 May 2019 18:17:59 +0200 Subject: [PATCH] Don't make handleStatus directly emit an event --- accounts/mastodon/mastodon.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/accounts/mastodon/mastodon.go b/accounts/mastodon/mastodon.go index 9ec1db4..ad44fa2 100644 --- a/accounts/mastodon/mastodon.go +++ b/accounts/mastodon/mastodon.go @@ -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) } }