diff options
author | Tollef Fog Heen <tfheen@err.no> | 2016-03-25 12:56:48 +0100 |
---|---|---|
committer | Tollef Fog Heen <tfheen@err.no> | 2016-03-27 12:06:55 +0200 |
commit | cc889e2c753f7c7d5f86954b66020654ee7ed689 (patch) | |
tree | c1aaaab65d156e0f8e03d7e0b29bdcb587197f06 /wee_slack.py | |
parent | d66f7d16dd147a2021ea7722e3544e5365a2d9a3 (diff) | |
download | wee-slack-cc889e2c753f7c7d5f86954b66020654ee7ed689.tar.gz |
Fix up displayed user name for new user and new channel messages
Use the value from the config option weechat.look.prefix_network if no
user is passed in. Thanks to @bendem for the suggestion to use this
rather than a hard coded string.
This also fixes a bug where the server buffer was passed as the
message and the user was set to "New user joined: foo".
Diffstat (limited to 'wee_slack.py')
-rw-r--r-- | wee_slack.py | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/wee_slack.py b/wee_slack.py index 85065be..746342e 100644 --- a/wee_slack.py +++ b/wee_slack.py @@ -329,6 +329,8 @@ class SlackServer(object): tags = "no_highlight,notify_none,logger_backlog_end" else: tags = "" + if user == "SYSTEM": + user = w.config_string(w.config_get('weechat.look.prefix_network')) if self.buffer: w.prnt_date_tags(self.buffer, 0, tags, "{}\t{}".format(user, message)) else: @@ -1379,7 +1381,7 @@ def process_team_join(message_json): server = servers.find(message_json["_server"]) item = message_json["user"] server.add_user(User(server, item["name"], item["id"], item["presence"])) - server.buffer_prnt(server.buffer, "New user joined: {}".format(item["name"])) + server.buffer_prnt("New user joined: {}".format(item["name"])) def process_manual_presence_change(message_json): process_presence_change(message_json) @@ -1505,7 +1507,7 @@ def process_im_created(message_json): else: item = message_json["channel"] server.add_channel(DmChannel(server, channel_name, item["id"], item["is_open"], item["last_read"])) - server.buffer_prnt("New channel created: {}".format(item["name"])) + server.buffer_prnt("New direct message channel created: {}".format(item["name"])) def process_user_typing(message_json): |