aboutsummaryrefslogtreecommitdiffstats
path: root/slack/slack_conversation.py
diff options
context:
space:
mode:
Diffstat (limited to 'slack/slack_conversation.py')
-rw-r--r--slack/slack_conversation.py18
1 files changed, 9 insertions, 9 deletions
diff --git a/slack/slack_conversation.py b/slack/slack_conversation.py
index 20b1085..fd73385 100644
--- a/slack/slack_conversation.py
+++ b/slack/slack_conversation.py
@@ -4,7 +4,7 @@ import hashlib
import time
from collections import OrderedDict
from contextlib import contextmanager
-from typing import TYPE_CHECKING, Dict, List, NoReturn, Optional, Union
+from typing import TYPE_CHECKING, Dict, List, Mapping, NoReturn, Optional, Union
import weechat
@@ -196,11 +196,10 @@ class SlackConversationMessageHashes(Dict[SlackTs, str]):
self._setitem(ts_with_same_hash, other_short_hash)
self._inverse_map[other_short_hash] = ts_with_same_hash
- other_message = self._conversation.get_message(ts_with_same_hash)
- if other_message:
- run_async(self._conversation.rerender_message(other_message))
- for reply in other_message.replies:
- run_async(self._conversation.rerender_message(reply))
+ other_message = self._conversation.messages[ts_with_same_hash]
+ run_async(self._conversation.rerender_message(other_message))
+ for reply in other_message.replies:
+ run_async(self._conversation.rerender_message(reply))
self._setitem(key, short_hash)
self._inverse_map[short_hash] = key
@@ -249,6 +248,10 @@ class SlackConversation:
return self._info["id"]
@property
+ def messages(self) -> Mapping[SlackTs, SlackMessage]:
+ return self._messages
+
+ @property
def type(self) -> Literal["channel", "private", "mpim", "im"]:
if self._info["is_im"] is True:
return "im"
@@ -313,9 +316,6 @@ class SlackConversation:
finally:
self.completion_context = "ACTIVE_COMPLETION"
- def get_message(self, ts: SlackTs) -> Optional[SlackMessage]:
- return self._messages.get(ts)
-
async def open_if_open(self):
if "is_open" in self._info:
if self._info["is_open"]: