aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTrygve Aaberge <trygveaa@gmail.com>2018-06-08 13:37:31 +0200
committerTrygve Aaberge <trygveaa@gmail.com>2018-09-04 20:48:27 +0200
commitaa3490cf3682b872de7d2dfa988e12064a75ab1e (patch)
tree3eb92d129834bf4d98e49c6c61870e6f2d86c9d5
parentf51744fc56de0227137fd00d75b7df27291b3664 (diff)
downloadwee-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.md5
-rw-r--r--wee_slack.py7
2 files changed, 10 insertions, 2 deletions
diff --git a/README.md b/README.md
index 5a30537..4701c69 100644
--- a/README.md
+++ b/README.md
@@ -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