From 71b16e007c7166d08c60c42065c4d8c8ca68e60c Mon Sep 17 00:00:00 2001 From: xX7 Date: Wed, 18 Sep 2013 16:08:55 +0200 Subject: [PATCH 1/2] OnGetGroupParticipants Event Added Event, that will be fired when the user calls: "sendGetGroupsParticipants". --- src/php/whatsprot.class.php | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/src/php/whatsprot.class.php b/src/php/whatsprot.class.php index 18a63463..fc646a41 100644 --- a/src/php/whatsprot.class.php +++ b/src/php/whatsprot.class.php @@ -642,7 +642,7 @@ public function sendGetGroupsOwning() */ public function sendGetGroupsParticipants($gjid) { - $msgId = $this->createMsgId("getparticipants"); + $msgId = $this->createMsgId("getgroupparticipants"); $child = new ProtocolNode("list", array( "xmlns" => "w:g" @@ -2006,6 +2006,17 @@ protected function processInboundData($data) $groupList )); } + if($node->getAttribute('id') == 'getgroupparticipants'){ + + $groupId = reset(explode('@', $node->getAttribute('from'))); + + $this->eventManager()->fire('onGetGroupParticipants', array( + $this->phoneNumber, + $groupId, + $groupList + )); + } + } } if ($node->getTag() == "iq" && $node->getAttribute('type') == "error") { From 1b04ed7d564368147e43c4f3f7122a95788410e2 Mon Sep 17 00:00:00 2001 From: xX7 Date: Wed, 18 Sep 2013 16:16:58 +0200 Subject: [PATCH 2/2] Changed Format. I luv copy paste... --- src/php/whatsprot.class.php | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/php/whatsprot.class.php b/src/php/whatsprot.class.php index fc646a41..babf48f0 100644 --- a/src/php/whatsprot.class.php +++ b/src/php/whatsprot.class.php @@ -2007,12 +2007,10 @@ protected function processInboundData($data) )); } if($node->getAttribute('id') == 'getgroupparticipants'){ - - $groupId = reset(explode('@', $node->getAttribute('from'))); - + $groupId = reset(explode('@', $node->getAttribute('from'))); $this->eventManager()->fire('onGetGroupParticipants', array( $this->phoneNumber, - $groupId, + $groupId, $groupList )); }