diff --git a/src/controller/mastodon/handler.py b/src/controller/mastodon/handler.py index 182c4b24..68cd74a8 100644 --- a/src/controller/mastodon/handler.py +++ b/src/controller/mastodon/handler.py @@ -98,7 +98,7 @@ class Handler(object): users.insert(0, item.reblog.account.acct) else: users = [user.acct for user in item.mentions if user.id != buffer.session.db["user_id"]] - if item.account.acct not in users and item.account.id != buffer.session.db["user_id"]: + if item.account.acct not in users: users.insert(0, item.account.acct) u = userActions.userActions(buffer.session, users) diff --git a/src/controller/mastodon/userActions.py b/src/controller/mastodon/userActions.py index 09b10d28..b9ce231d 100644 --- a/src/controller/mastodon/userActions.py +++ b/src/controller/mastodon/userActions.py @@ -25,9 +25,8 @@ class BasicUserSelector(object): def search_user(self, user): try: - users = self.session.api.account_search(user) - if len(users) > 0: - return users[0] + user = self.session.api.account_lookup(user) + return user except MastodonError: log.exception("Error searching for user %s.".format(user)) diff --git a/src/sessions/mastodon/streaming.py b/src/sessions/mastodon/streaming.py index 91461a65..e74fc2d5 100644 --- a/src/sessions/mastodon/streaming.py +++ b/src/sessions/mastodon/streaming.py @@ -18,5 +18,5 @@ class StreamListener(mastodon.StreamListener): def on_notification(self, notification): pub.sendMessage("mastodon.notification_received", notification=notification, session_name=self.session_name) - def on_unknown_event(self, event): - log.error("Unknown event: {}".format(event)) + def on_unknown_event(self, event, payload): + log.error("Unknown event: {} with payload as {}".format(event, payload))