aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--slack/slack_conversation.py18
-rw-r--r--slack/slack_message.py2
2 files changed, 10 insertions, 10 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"]:
diff --git a/slack/slack_message.py b/slack/slack_message.py
index 0a1870b..032df91 100644
--- a/slack/slack_message.py
+++ b/slack/slack_message.py
@@ -142,7 +142,7 @@ class SlackMessage:
def parent_message(self) -> Optional[SlackMessage]:
if not self.is_reply or self.thread_ts is None:
return None
- return self.conversation.get_message(self.thread_ts)
+ return self.conversation.messages[self.thread_ts]
@property
def is_bot_message(self) -> bool: