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) users.insert(0, item.reblog.account.acct)
else: else:
users = [user.acct for user in item.mentions if user.id != buffer.session.db["user_id"]] 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) users.insert(0, item.account.acct)
u = userActions.userActions(buffer.session, users) u = userActions.userActions(buffer.session, users)

View File

@ -25,9 +25,8 @@ class BasicUserSelector(object):
def search_user(self, user): def search_user(self, user):
try: try:
users = self.session.api.account_search(user) user = self.session.api.account_lookup(user)
if len(users) > 0: return user
return users[0]
except MastodonError: except MastodonError:
log.exception("Error searching for user %s.".format(user)) log.exception("Error searching for user %s.".format(user))

View File

@ -18,5 +18,5 @@ class StreamListener(mastodon.StreamListener):
def on_notification(self, notification): def on_notification(self, notification):
pub.sendMessage("mastodon.notification_received", notification=notification, session_name=self.session_name) pub.sendMessage("mastodon.notification_received", notification=notification, session_name=self.session_name)
def on_unknown_event(self, event): def on_unknown_event(self, event, payload):
log.error("Unknown event: {}".format(event)) log.error("Unknown event: {} with payload as {}".format(event, payload))