mirror of
https://github.com/MCV-Software/TWBlue.git
synced 2024-11-26 12:53:12 -06:00
Added some fixes
This commit is contained in:
parent
b7497791b4
commit
8d2fb59ba8
@ -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)
|
||||||
|
|
||||||
|
@ -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))
|
||||||
|
|
||||||
|
@ -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))
|
||||||
|
Loading…
Reference in New Issue
Block a user