Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mrDoctorWho/vk4xmpp.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Smith <mrdoctorwho@gmail.com>2017-04-28 10:05:29 +0300
committerJohn Smith <mrdoctorwho@gmail.com>2017-04-28 10:05:29 +0300
commit5cf6b01b563051be61ed9ab7a3f3da125465efb4 (patch)
treeafc16f20dc04ea31f2ff4ac1c781665d810a440d
parenta7d8d72ddf23054e15944e806200a44868c863e0 (diff)
Light refactoring in groupchats.py
-rw-r--r--extensions/groupchats.py13
1 files changed, 8 insertions, 5 deletions
diff --git a/extensions/groupchats.py b/extensions/groupchats.py
index 454e935..9bf7717 100644
--- a/extensions/groupchats.py
+++ b/extensions/groupchats.py
@@ -395,12 +395,15 @@ class Chat(object):
"""
Split the source and return required parts
"""
- node, domain = source.split("@")
- if "_chat#" in node:
- creator, id = node.split("_chat#")
- else:
+ node, domain = source.split("@", 1)
+ if "_chat#" not in node:
return (None, None, None)
- return (int(creator), int(id), domain)
+ if "/" in domain:
+ domain = domain.split("/")[0]
+ creator, id = node.split("_chat#", 1)
+ creator = int(creator)
+ id = int(id)
+ return (creator, id, domain)
@classmethod
def getUserObject(cls, source):