Added some fixes

This commit is contained in:
Manuel Cortez 2022-11-24 15:22:09 -06:00
parent b7497791b4
commit 8d2fb59ba8
No known key found for this signature in database
GPG Key ID: 9E0735CA15EFE790
3 changed files with 5 additions and 6 deletions

View File

@ -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)

View File

@ -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))

View File

@ -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))