diff options
author | Trygve Aaberge <trygveaa@gmail.com> | 2018-06-08 13:37:31 +0200 |
---|---|---|
committer | Trygve Aaberge <trygveaa@gmail.com> | 2018-09-04 20:48:27 +0200 |
commit | aa3490cf3682b872de7d2dfa988e12064a75ab1e (patch) | |
tree | 3eb92d129834bf4d98e49c6c61870e6f2d86c9d5 | |
parent | f51744fc56de0227137fd00d75b7df27291b3664 (diff) | |
download | wee-slack-aa3490cf3682b872de7d2dfa988e12064a75ab1e.tar.gz |
Implement showmuted command properly
Show channel names instead of id's, and show them in a more readable
format.
-rw-r--r-- | README.md | 5 | ||||
-rw-r--r-- | wee_slack.py | 7 |
2 files changed, 10 insertions, 2 deletions
@@ -182,6 +182,11 @@ Toggle muting of the current channel: /slack mute ``` +List muted channels for the current team: +``` +/slack showmuted +``` + Modify previous message: ``` s/old text/new text/ diff --git a/wee_slack.py b/wee_slack.py index 2a0a7b5..605456c 100644 --- a/wee_slack.py +++ b/wee_slack.py @@ -3426,8 +3426,11 @@ def command_talk(data, current_buffer, args): def command_showmuted(data, current_buffer, args): - current = w.current_buffer() - w.prnt(EVENTROUTER.weechat_controller.buffers[current].team.channel_buffer, str(EVENTROUTER.weechat_controller.buffers[current].team.muted_channels)) + team = EVENTROUTER.weechat_controller.buffers[current_buffer].team + muted_channels = [team.channels[key].name + for key in team.muted_channels if key in team.channels] + team.buffer_prnt("Muted channels: {}".format(', '.join(muted_channels))) + return w.WEECHAT_RC_OK_EAT @utf8_decode |