diff options
-rw-r--r-- | wee_slack.py | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/wee_slack.py b/wee_slack.py index c8d24ee..44ae072 100644 --- a/wee_slack.py +++ b/wee_slack.py @@ -291,7 +291,10 @@ class SlackServer(object): if "last_read" not in item: item["last_read"] = 0 if not item["is_archived"]: - self.add_channel(GroupChannel(self, item["name"], item["id"], item["is_open"], item["last_read"], "#", item["members"], item["topic"]["value"])) + if item["name"].startswith("mpdm-"): + self.add_channel(MpdmChannel(self, item["name"], item["id"], item["is_open"], item["last_read"], "#", item["members"], item["topic"]["value"])) + else: + self.add_channel(GroupChannel(self, item["name"], item["id"], item["is_open"], item["last_read"], "#", item["members"], item["topic"]["value"])) for item in data["ims"]: if "last_read" not in item: item["last_read"] = 0 @@ -723,6 +726,12 @@ class GroupChannel(Channel): super(GroupChannel, self).__init__(server, name, identifier, active, last_read, prepend_name, members, topic) self.type = "group" +class MpdmChannel(Channel): + + def __init__(self, server, name, identifier, active, last_read=0, prepend_name="", members=[], topic=""): + name = ",".join("-".join(name.split("-")[1:-1]).split("--")) + super(MpdmChannel, self).__init__(server, name, identifier, active, last_read, prepend_name, members, topic) + self.type = "group" class DmChannel(Channel): |