diff --git a/src/controller/mainController.py b/src/controller/mainController.py index 3c913261..b60e2e42 100644 --- a/src/controller/mainController.py +++ b/src/controller/mainController.py @@ -1247,10 +1247,9 @@ class Controller(object): def mastodon_new_conversation(self, conversation, session_name): buffer = self.search_buffer("direct_messages", session_name) if buffer == None: - print("Buffer not found.") + log.error("Buffer not found: direct_messages on {}".format(session_name)) return # Direct messages buffer is hidden new_position, number_of_items = buffer.order_buffer([conversation]) - print(new_position, number_of_items) buffer.put_items_on_list(number_of_items) if new_position > -1: buffer.buffer.list.select_item(new_position) diff --git a/src/sessions/mastodon/streaming.py b/src/sessions/mastodon/streaming.py index c01f993d..91461a65 100644 --- a/src/sessions/mastodon/streaming.py +++ b/src/sessions/mastodon/streaming.py @@ -13,7 +13,6 @@ class StreamListener(mastodon.StreamListener): pub.sendMessage("mastodon.status_received", status=status, session_name=self.session_name) def on_conversation(self, conversation): - print("New conversation: {}".format(conversation)) pub.sendMessage("mastodon.conversation_received", conversation=conversation, session_name=self.session_name) def on_notification(self, notification): diff --git a/src/sessions/mastodon/utils.py b/src/sessions/mastodon/utils.py index 2ea6b57a..b54923f7 100644 --- a/src/sessions/mastodon/utils.py +++ b/src/sessions/mastodon/utils.py @@ -35,13 +35,15 @@ def is_audio_or_video(post): def is_image(post): if post.reblog != None: - return is_audio_or_video(post.reblog) + return is_image(post.reblog) # Checks firstly for Mastodon native videos and audios. for media in post.media_attachments: if media["type"] == "gifv" or media["type"] == "image": return True def get_media_urls(post): + if hasattr(post, "reblog") and post.reblog != None: + return get_media_urls(post.reblog) urls = [] for media in post.media_attachments: if media.get("type") == "audio" or media.get("type") == "video":