aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTrygve Aaberge <trygveaa@gmail.com>2023-08-24 21:07:07 +0200
committerTrygve Aaberge <trygveaa@gmail.com>2024-02-18 11:32:54 +0100
commit236c7a90671716702a630d2701af4d961b51d97c (patch)
treecf8910f9e37108cd7e20ef868e91ae8e1b701b1b
parent711f1e10211f02be2190c22efbaf297ead70af4a (diff)
downloadwee-slack-236c7a90671716702a630d2701af4d961b51d97c.tar.gz
Rename add_message and add some TODOs
-rw-r--r--slack/commands.py1
-rw-r--r--slack/slack_conversation.py3
-rw-r--r--slack/slack_message.py1
-rw-r--r--slack/slack_workspace.py2
4 files changed, 5 insertions, 2 deletions
diff --git a/slack/commands.py b/slack/commands.py
index 33381e9..b1ac545 100644
--- a/slack/commands.py
+++ b/slack/commands.py
@@ -291,6 +291,7 @@ def print_uncaught_error(
def command_slack_debug(
buffer: str, args: List[str], options: Dict[str, Optional[str]]
):
+ # TODO: Add message info (message_json)
if args[0] == "tasks":
weechat.prnt("", "Active tasks:")
weechat.prnt("", pprint.pformat(shared.active_tasks))
diff --git a/slack/slack_conversation.py b/slack/slack_conversation.py
index 32048c2..211d156 100644
--- a/slack/slack_conversation.py
+++ b/slack/slack_conversation.py
@@ -358,7 +358,8 @@ class SlackConversation:
self.buffer_pointer, "", user.nick(), color, "", "", 1
)
- async def add_message(self, message: SlackMessage):
+ async def add_new_message(self, message: SlackMessage):
+ # TODO: Remove old messages
self._messages[message.ts] = message
if self.history_filled:
await self.print_message(message)
diff --git a/slack/slack_message.py b/slack/slack_message.py
index 356f05a..920d501 100644
--- a/slack/slack_message.py
+++ b/slack/slack_message.py
@@ -162,6 +162,7 @@ class SlackMessage:
self._rendered_message = None
async def tags(self, backlog: bool = False) -> str:
+ # TODO: Add tags for highlight
nick = await self._nick(colorize=False, only_nick=True)
tags = [f"slack_ts_{self.ts}", f"nick_{nick}"]
diff --git a/slack/slack_workspace.py b/slack/slack_workspace.py
index f721bda..b730987 100644
--- a/slack/slack_workspace.py
+++ b/slack/slack_workspace.py
@@ -300,7 +300,7 @@ class SlackWorkspace:
pass
else:
message = SlackMessage(channel, data)
- await channel.add_message(message)
+ await channel.add_new_message(message)
elif data["type"] == "reaction_added" and data["item"]["type"] == "message":
await channel.reaction_add(
SlackTs(data["item"]["ts"]), data["reaction"], data["user"]