diff --git a/src/php/whatsprot.class.php b/src/php/whatsprot.class.php index 28567e34..04f61a51 100644 --- a/src/php/whatsprot.class.php +++ b/src/php/whatsprot.class.php @@ -810,18 +810,27 @@ public function sendGetServerProperties() * Get the current status message of a specific user. * * @deprecated Use ContactSyncV2 to get status - * @param string $jid The user JID + * @param string[] $jids The users' JIDs */ - public function sendGetStatus($jid) + public function sendGetStatuses($jids) { - $parts = explode("@", $jid); - $to = $parts[0] . "@s.us"; - $child = new ProtocolNode("action", array("type" => "get"), null, null); - $node = new ProtocolNode("message", array( - "to" => $to, - "type" => "action", - "id" => $this->createMsgId("message") - ), array($child), null); + if(!is_array($jids)) + { + $jids = array($jids); + } + $children = array(); + foreach($jids as $jid) + { + $children[] = new ProtocolNode("user", array("jid" => $this->getJID($jid)), null, null); + } + $node = new ProtocolNode("iq", array( + "to" => "s.whatsapp.net", + "type" => "get", + "xmlns" => "status", + "id" => $this->createMsgId("getstatus") + ), array( + new ProtocolNode("status", null, $children, null) + ), null); $this->sendNode($node); }