diff options
-rw-r--r-- | _pytest/test_topic_command.py | 2 | ||||
-rw-r--r-- | wee_slack.py | 19 |
2 files changed, 11 insertions, 10 deletions
diff --git a/_pytest/test_topic_command.py b/_pytest/test_topic_command.py index b4c851d..2137c27 100644 --- a/_pytest/test_topic_command.py +++ b/_pytest/test_topic_command.py @@ -86,7 +86,7 @@ def test_call_topic_with_channel_and_string(realish_eventrouter, channel_general result = topic_command_cb(None, current_buffer, command) request = realish_eventrouter.queue[-1] - assert request.request == 'channels.setTopic' + assert request.request == 'conversations.setTopic' assert request.post_data == { 'channel': 'C407ABS94', 'token': 'xoxs-token', 'topic': 'new topic'} assert result == wee_slack.w.WEECHAT_RC_OK_EAT 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 |