Skip to content

Commit 7ace84e

Browse files
ardianysshirioko
authored andcommitted
update profile picture update notification
profile picture update notification node now without message node
1 parent 936b261 commit 7ace84e

File tree

1 file changed

+15
-17
lines changed

1 file changed

+15
-17
lines changed

src/whatsprot.class.php

+15-17
Original file line numberDiff line numberDiff line change
@@ -1973,23 +1973,6 @@ protected function processInboundDataNode(ProtocolNode $node, $autoReceipt = tru
19731973
$this->sendMessageReceived($node);
19741974
}
19751975
}
1976-
if ($node->hasChild('notification') && $node->getChild('notification')->getAttribute('type') == 'picture') {
1977-
if ($node->getChild('notification')->hasChild('set')) {
1978-
$this->eventManager()->fireProfilePictureChanged(
1979-
$this->phoneNumber,
1980-
$node->getAttribute('from'),
1981-
$node->getAttribute('id'),
1982-
$node->getAttribute('t')
1983-
);
1984-
} else if ($node->getChild('notification')->hasChild('delete')) {
1985-
$this->eventManager()->fireProfilePictureDeleted(
1986-
$this->phoneNumber,
1987-
$node->getAttribute('from'),
1988-
$node->getAttribute('id'),
1989-
$node->getAttribute('t')
1990-
);
1991-
}
1992-
}
19931976
if ($node->getAttribute("type") == "media" && $node->getChild('media') != null) {
19941977
if ($node->getChild("media")->getAttribute('type') == 'image') {
19951978
$this->eventManager()->fireGetImage(
@@ -2354,6 +2337,21 @@ protected function processInboundDataNode(ProtocolNode $node, $autoReceipt = tru
23542337
$node->getChild(0)->getData()); //status message
23552338
break;
23562339
case "picture":
2340+
if ($node->hasChild('set')) {
2341+
$this->eventManager()->fireProfilePictureChanged(
2342+
$this->phoneNumber,
2343+
$node->getAttribute('from'),
2344+
$node->getAttribute('id'),
2345+
$node->getAttribute('t')
2346+
);
2347+
} else if ($node->hasChild('delete')) {
2348+
$this->eventManager()->fireProfilePictureDeleted(
2349+
$this->phoneNumber,
2350+
$node->getAttribute('from'),
2351+
$node->getAttribute('id'),
2352+
$node->getAttribute('t')
2353+
);
2354+
}
23572355
//TODO
23582356
break;
23592357
case "contacts":

0 commit comments

Comments
 (0)