aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--slack/slack_buffer.py1
-rw-r--r--slack/slack_conversation.py9
-rw-r--r--slack/slack_thread.py6
3 files changed, 4 insertions, 12 deletions
diff --git a/slack/slack_buffer.py b/slack/slack_buffer.py
index 4c88d4c..4732521 100644
--- a/slack/slack_buffer.py
+++ b/slack/slack_buffer.py
@@ -152,7 +152,6 @@ class SlackBuffer(ABC):
# TODO: buffer_pointer may be accessed by buffer_switch before it's initialized
self.buffer_pointer: Optional[str] = None
self.is_loading = False
- self.history_pending = False
self.history_pending_messages: List[SlackMessage] = []
self.history_needs_refresh = False
self.last_printed_ts: Optional[SlackTs] = None
diff --git a/slack/slack_conversation.py b/slack/slack_conversation.py
index cf965da..d43624b 100644
--- a/slack/slack_conversation.py
+++ b/slack/slack_conversation.py
@@ -455,7 +455,7 @@ class SlackConversation(SlackBuffer):
self.hotlist_tss.add(message.latest_reply)
async def fill_history(self, update: bool = False):
- if self.history_pending:
+ if self.is_loading:
return
if (
@@ -466,8 +466,6 @@ class SlackConversation(SlackBuffer):
return
with self.loading():
- self.history_pending = True
-
history_after_ts = (
next(iter(self._messages), None)
if self.history_needs_refresh
@@ -548,7 +546,6 @@ class SlackConversation(SlackBuffer):
await self.print_message(message)
self.history_needs_refresh = False
- self.history_pending = False
async def nicklist_update(self):
if self.nicklist_needs_refresh and self.type != "im":
@@ -615,7 +612,7 @@ class SlackConversation(SlackBuffer):
self._messages[message.ts] = message
if self.should_display_message(message):
- if self.history_pending:
+ if self.is_loading:
self.history_pending_messages.append(message)
elif self.last_printed_ts is not None:
await self.print_message(message)
@@ -630,7 +627,7 @@ class SlackConversation(SlackBuffer):
parent_message.replies[message.ts] = message
thread_buffer = parent_message.thread_buffer
if thread_buffer:
- if thread_buffer.history_pending:
+ if thread_buffer.is_loading:
thread_buffer.history_pending_messages.append(message)
else:
await thread_buffer.print_message(message)
diff --git a/slack/slack_thread.py b/slack/slack_thread.py
index fe86b23..62d02ed 100644
--- a/slack/slack_thread.py
+++ b/slack/slack_thread.py
@@ -103,15 +103,12 @@ class SlackThread(SlackBuffer):
await self.print_message(message)
async def fill_history(self):
- if self.history_pending:
+ if self.is_loading:
return
with self.loading():
- self.history_pending = True
-
if self.parent.reply_history_filled and not self.history_needs_refresh:
await self.print_history()
- self.history_pending = False
return
messages = await self.parent.conversation.fetch_replies(self.parent.ts)
@@ -133,7 +130,6 @@ class SlackThread(SlackBuffer):
await self.print_history()
self.history_needs_refresh = False
- self.history_pending = False
async def print_message(self, message: SlackMessage):
did_print = await super().print_message(message)