Skip to content

Commit

Permalink
Merge branch 'jlguardi-groups_notification' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
tgalal committed Dec 28, 2017
2 parents b051ac6 + c2074a4 commit 8536c7e
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
from yowsup.structs import ProtocolTreeNode
class RemoveGroupsNotificationProtocolEntity(GroupsNotificationProtocolEntity):
'''
<notification notify="{{NOTIFY_NAME}}" id="{{id}}" t="{{TIMESTAMP}}" participant="{{participant_jiid}}" from="{{group_jid}}" type="w:gp2">
<notification notify="{{NOTIFY_NAME}}" id="{{id}}" t="{{TIMESTAMP}}" participant="{{participant_jiid}}" from="{{group_jid}}" type="w:gp2" mode="none">
<remove subject="{{subject}}">
<participant jid="{{participant_jid}}">
</participant>
Expand All @@ -20,7 +20,7 @@ def setGroupProps(self,
subject,
participants):

assert type(participants) is dict, "Participants must be a dict {jid => type?}"
assert type(participants) is list, "Must be a list of jids, got %s instead." % type(participants)

self.subject = subject
self.participants = participants
Expand All @@ -47,9 +47,9 @@ def toProtocolTreeNode(self):
@staticmethod
def fromProtocolTreeNode(node):
removeNode = node.getChild("remove")
participants = {}
participants = []
for p in removeNode.getAllChildren("participant"):
participants[p["jid"]] = p["type"]
participants.append(p["jid"])

return RemoveGroupsNotificationProtocolEntity(
node["id"], node["from"], node["t"], node["notify"], node["participant"], node["offline"],
Expand Down

0 comments on commit 8536c7e

Please sign in to comment.