diff --git a/src/controller/buffers/mastodon/base.py b/src/controller/buffers/mastodon/base.py index df89915c..523cdd4c 100644 --- a/src/controller/buffers/mastodon/base.py +++ b/src/controller/buffers/mastodon/base.py @@ -93,7 +93,10 @@ class BaseBuffer(base.Buffer): min_id = None # toDo: Implement reverse timelines properly here. if (self.name != "favorites" and self.name != "bookmarks") and self.name in self.session.db and len(self.session.db[self.name]) > 0: - min_id = self.session.db[self.name][-1].id + if self.session.settings["general"]["reverse_timelines"]: + min_id = self.session.db[self.name][0].id + else: + min_id = self.session.db[self.name][-1].id try: results = getattr(self.session.api, self.function)(min_id=min_id, limit=count, *self.args, **self.kwargs) results.reverse() @@ -152,7 +155,7 @@ class BaseBuffer(base.Buffer): post = self.compose_function(i, self.session.db, self.session.settings["general"]["relative_times"], self.session.settings["general"]["show_screen_names"]) self.buffer.list.insert_item(True, *post) else: - for i in items: + for i in elements: post = self.compose_function(i, self.session.db, self.session.settings["general"]["relative_times"], self.session.settings["general"]["show_screen_names"]) self.buffer.list.insert_item(False, *post) self.buffer.list.select_item(selection) diff --git a/src/controller/buffers/mastodon/conversations.py b/src/controller/buffers/mastodon/conversations.py index 6ae5ccc4..e00a2c02 100644 --- a/src/controller/buffers/mastodon/conversations.py +++ b/src/controller/buffers/mastodon/conversations.py @@ -46,9 +46,6 @@ class ConversationListBuffer(BaseBuffer): log.debug("args: %s, kwargs: %s" % (self.args, self.kwargs)) count = self.session.settings["general"]["max_posts_per_call"] min_id = None - # toDo: Implement reverse timelines properly here. -# if (self.name != "favorites" and self.name != "bookmarks") and self.name in self.session.db and len(self.session.db[self.name]) > 0: -# min_id = self.session.db[self.name][-1].id try: results = getattr(self.session.api, self.function)(min_id=min_id, limit=count, *self.args, **self.kwargs) results.reverse() @@ -94,7 +91,7 @@ class ConversationListBuffer(BaseBuffer): conversation = self.compose_function(i, self.session.db, self.session.settings["general"]["relative_times"], self.session.settings["general"]["show_screen_names"]) self.buffer.list.insert_item(True, *conversation) else: - for i in items: + for i in elements: conversation = self.compose_function(i, self.session.db, self.session.settings["general"]["relative_times"], self.session.settings["general"]["show_screen_names"]) self.buffer.list.insert_item(False, *conversation) self.buffer.list.select_item(selection) diff --git a/src/controller/buffers/mastodon/mentions.py b/src/controller/buffers/mastodon/mentions.py index c7968c31..1e6402c8 100644 --- a/src/controller/buffers/mastodon/mentions.py +++ b/src/controller/buffers/mastodon/mentions.py @@ -16,9 +16,6 @@ class MentionsBuffer(BaseBuffer): log.debug("args: %s, kwargs: %s" % (self.args, self.kwargs)) count = self.session.settings["general"]["max_posts_per_call"] min_id = None - # toDo: Implement reverse timelines properly here. -# if self.name != "favorites" and self.name in self.session.db and len(self.session.db[self.name]) > 0: -# min_id = self.session.db[self.name][-1].id try: items = getattr(self.session.api, self.function)(min_id=min_id, limit=count, exclude_types=["follow", "favourite", "reblog", "poll", "follow_request"], *self.args, **self.kwargs) items.reverse() @@ -64,7 +61,7 @@ class MentionsBuffer(BaseBuffer): post = self.compose_function(i, self.session.db, self.session.settings["general"]["relative_times"], self.session.settings["general"]["show_screen_names"]) self.buffer.list.insert_item(True, *post) else: - for i in items: + for i in elements: post = self.compose_function(i, self.session.db, self.session.settings["general"]["relative_times"], self.session.settings["general"]["show_screen_names"]) self.buffer.list.insert_item(False, *post) self.buffer.list.select_item(selection) diff --git a/src/controller/buffers/mastodon/users.py b/src/controller/buffers/mastodon/users.py index 8ba4f4f5..84f73145 100644 --- a/src/controller/buffers/mastodon/users.py +++ b/src/controller/buffers/mastodon/users.py @@ -75,7 +75,6 @@ class UserBuffer(BaseBuffer): log.debug("Starting stream for buffer %s, account %s and type %s" % (self.name, self.account, self.type)) log.debug("args: %s, kwargs: %s" % (self.args, self.kwargs)) count = self.session.settings["general"]["max_posts_per_call"] - # toDo: Implement reverse timelines properly here. try: results = getattr(self.session.api, self.function)(limit=count, *self.args, **self.kwargs) if hasattr(results, "_pagination_next") and self.name not in self.session.db["pagination_info"]: @@ -127,7 +126,7 @@ class UserBuffer(BaseBuffer): post = self.compose_function(i, self.session.db, self.session.settings["general"]["relative_times"], self.session.settings["general"]["show_screen_names"]) self.buffer.list.insert_item(True, *post) else: - for i in items: + for i in elements: post = self.compose_function(i, self.session.db, self.session.settings["general"]["relative_times"], self.session.settings["general"]["show_screen_names"]) self.buffer.list.insert_item(False, *post) self.buffer.list.select_item(selection)