diff options
author | Trygve Aaberge <trygveaa@gmail.com> | 2019-06-12 17:42:37 +0200 |
---|---|---|
committer | Trygve Aaberge <trygveaa@gmail.com> | 2019-06-12 17:48:32 +0200 |
commit | 849ffc6bf123242cc20846d913768c7690e9fc5f (patch) | |
tree | 84449e582ef21cc42ae9917b9f05db9cc7636ee1 /wee_slack.py | |
parent | 65ecb1ac81362b2e3f4c6dcbb8007bc58301b6d6 (diff) | |
download | wee-slack-849ffc6bf123242cc20846d913768c7690e9fc5f.tar.gz |
Support topic changes for private channels
Fixes #697
Diffstat (limited to 'wee_slack.py')
-rw-r--r-- | wee_slack.py | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/wee_slack.py b/wee_slack.py index 5f016e1..1ac07a7 100644 --- a/wee_slack.py +++ b/wee_slack.py @@ -2988,8 +2988,17 @@ def subprocess_channel_leave(message_json, eventrouter, channel, team, history_m channel.store_message(message, team) +def subprocess_channel_topic(message_json, eventrouter, channel, team, history_message): + prefix_topic = w.prefix("network").strip() + message = SlackMessage(message_json, team, channel, override_sender=prefix_topic) + channel.buffer_prnt(prefix_topic, channel.render(message), message_json["ts"], tagset="topic", tag_nick=message.get_sender()[1], history_message=history_message) + channel.set_topic(message_json["topic"]) + channel.store_message(message, team) + + subprocess_group_join = subprocess_channel_join subprocess_group_leave = subprocess_channel_leave +subprocess_group_topic = subprocess_channel_topic def subprocess_message_replied(message_json, eventrouter, channel, team, history_message): @@ -3015,14 +3024,6 @@ def subprocess_message_deleted(message_json, eventrouter, channel, team, history channel.change_message(message_json["deleted_ts"], text=message) -def subprocess_channel_topic(message_json, eventrouter, channel, team, history_message): - prefix_topic = w.prefix("network").strip() - message = SlackMessage(message_json, team, channel, override_sender=prefix_topic) - channel.buffer_prnt(prefix_topic, channel.render(message), message_json["ts"], tagset="topic", tag_nick=message.get_sender()[1], history_message=history_message) - channel.set_topic(message_json["topic"]) - channel.store_message(message, team) - - def process_reply(message_json, eventrouter, **kwargs): team = kwargs["team"] reply_to = int(message_json["reply_to"]) @@ -3581,7 +3582,7 @@ def topic_command_cb(data, current_buffer, command): w.prnt(channel.channel_buffer, 'Topic for {} is "{}"'.format(channel.name, channel.render_topic())) else: - s = SlackRequest(team.token, "channels.setTopic", {"channel": channel.identifier, + s = SlackRequest(team.token, "conversations.setTopic", {"channel": channel.identifier, "topic": linkify_text(topic, team)}, team_hash=team.team_hash) EVENTROUTER.receive(s) return w.WEECHAT_RC_OK_EAT |