diff options
author | Ryan Huber <rhuber@gmail.com> | 2017-02-09 11:45:45 -0800 |
---|---|---|
committer | Ryan Huber <rhuber@gmail.com> | 2017-02-09 11:45:45 -0800 |
commit | 88cafdde3337c29c94e54da143bf81db0e489448 (patch) | |
tree | ce0ebda094be2fa933e9d54acfc25d3468f7cfc9 | |
parent | 584861d2ebde84bca10ca98c5ba267b5f56382bb (diff) | |
download | wee-slack-88cafdde3337c29c94e54da143bf81db0e489448.tar.gz |
use purpose if no topic
-rw-r--r-- | wee_slack.py | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/wee_slack.py b/wee_slack.py index f55d467..eef9c0f 100644 --- a/wee_slack.py +++ b/wee_slack.py @@ -953,6 +953,7 @@ class SlackChannel(object): self.eventrouter = eventrouter self.slack_name = kwargs["name"] self.slack_topic = kwargs.get("topic", {"value": ""}) + self.slack_purpose = kwargs.get("purpose", {"value": ""}) self.identifier = kwargs["id"] self.last_read = SlackTS(kwargs.get("last_read", SlackTS())) #print self.last_read @@ -1002,7 +1003,10 @@ class SlackChannel(object): def render_topic(self, topic=None): if self.channel_buffer: if not topic: - encoded_topic = self.slack_topic['value'].encode('utf-8') + if self.slack_topic['value'] != "": + encoded_topic = self.slack_topic['value'].encode('utf-8') + else: + encoded_topic = self.slack_purpose['value'].encode('utf-8') else: encoded_topic = topic.encode('utf-8') self.encoded_topic = topic.encode('utf-8') |