51 changed files with 166 additions and 1424 deletions
-
1app/widgets/Vcard4/Vcard4.php
-
36lib/moxl/src/Moxl/Stanza/Notification.php
-
39lib/moxl/src/Moxl/Xec/Action/Message/Composing.php
-
32lib/moxl/src/Moxl/Xec/Action/Message/Invite.php
-
39lib/moxl/src/Moxl/Xec/Action/Message/Paused.php
-
80lib/moxl/src/Moxl/Xec/Action/Message/Publish.php
-
38lib/moxl/src/Moxl/Xec/Action/Microblog/CommentCreateNode.php
-
17lib/moxl/src/Moxl/Xec/Action/Microblog/CommentPublish.php
-
21lib/moxl/src/Moxl/Xec/Action/Microblog/CommentsGet.php
-
8lib/moxl/src/Moxl/Xec/Action/Muc/GetConfig.php
-
16lib/moxl/src/Moxl/Xec/Action/Muc/SetConfig.php
-
16lib/moxl/src/Moxl/Xec/Action/Muc/SetSubject.php
-
9lib/moxl/src/Moxl/Xec/Action/Nickname/Set.php
-
61lib/moxl/src/Moxl/Xec/Action/Notification/Get.php
-
57lib/moxl/src/Moxl/Xec/Action/Notification/ItemDelete.php
-
52lib/moxl/src/Moxl/Xec/Action/Pubsub/ConfigurePersistentStorage.php
-
24lib/moxl/src/Moxl/Xec/Action/Pubsub/Create.php
-
44lib/moxl/src/Moxl/Xec/Action/Pubsub/CreatePersistentStorage.php
-
16lib/moxl/src/Moxl/Xec/Action/Pubsub/Delete.php
-
22lib/moxl/src/Moxl/Xec/Action/Pubsub/Errors.php
-
38lib/moxl/src/Moxl/Xec/Action/Pubsub/GetAffiliations.php
-
40lib/moxl/src/Moxl/Xec/Action/Pubsub/GetConfig.php
-
62lib/moxl/src/Moxl/Xec/Action/Pubsub/GetItem.php
-
61lib/moxl/src/Moxl/Xec/Action/Pubsub/GetItems.php
-
16lib/moxl/src/Moxl/Xec/Action/Pubsub/GetItemsId.php
-
40lib/moxl/src/Moxl/Xec/Action/Pubsub/GetSubscriptions.php
-
24lib/moxl/src/Moxl/Xec/Action/Pubsub/PostDelete.php
-
46lib/moxl/src/Moxl/Xec/Action/Pubsub/SetAffiliations.php
-
53lib/moxl/src/Moxl/Xec/Action/Pubsub/SetConfig.php
-
46lib/moxl/src/Moxl/Xec/Action/Pubsub/SetSubscriptions.php
-
32lib/moxl/src/Moxl/Xec/Action/Pubsub/Subscribe.php
-
14lib/moxl/src/Moxl/Xec/Action/Pubsub/TestCreate.php
-
24lib/moxl/src/Moxl/Xec/Action/Pubsub/TestPostPublish.php
-
32lib/moxl/src/Moxl/Xec/Action/Pubsub/Unsubscribe.php
-
40lib/moxl/src/Moxl/Xec/Action/PubsubSubscription/Add.php
-
16lib/moxl/src/Moxl/Xec/Action/PubsubSubscription/Get.php
-
32lib/moxl/src/Moxl/Xec/Action/PubsubSubscription/Remove.php
-
24lib/moxl/src/Moxl/Xec/Action/Roster/AddItem.php
-
5lib/moxl/src/Moxl/Xec/Action/Roster/GetList.php
-
8lib/moxl/src/Moxl/Xec/Action/Roster/RemoveItem.php
-
26lib/moxl/src/Moxl/Xec/Action/Roster/UpdateItem.php
-
8lib/moxl/src/Moxl/Xec/Action/Session/Bind.php
-
8lib/moxl/src/Moxl/Xec/Action/Session/Start.php
-
22lib/moxl/src/Moxl/Xec/Action/Storage/Get.php
-
22lib/moxl/src/Moxl/Xec/Action/Storage/Set.php
-
52lib/moxl/src/Moxl/Xec/Action/Upload/Request.php
-
22lib/moxl/src/Moxl/Xec/Action/Vcard/Get.php
-
39lib/moxl/src/Moxl/Xec/Action/Vcard/Set.php
-
40lib/moxl/src/Moxl/Xec/Action/Vcard4/Get.php
-
8lib/moxl/src/Moxl/Xec/Action/Vcard4/Set.php
-
62lib/moxl/src/Moxl/Xec/Action/Version/Send.php
@ -1,36 +0,0 @@ |
|||
<?php |
|||
|
|||
namespace Moxl\Stanza; |
|||
|
|||
class Notification { |
|||
static function get($to) |
|||
{ |
|||
$dom = new \DOMDocument('1.0', 'UTF-8'); |
|||
$pubsub = $dom->createElementNS('http://jabber.org/protocol/pubsub', 'pubsub'); |
|||
$items = $dom->createElementNS('items'); |
|||
$items->setAttribute('node', 'urn:xmpp:inbox'); |
|||
|
|||
$pubsub->appendChild($items); |
|||
|
|||
$xml = \Moxl\API::iqWrapper($pubsub, $to, 'get'); |
|||
\Moxl\API::request($xml); |
|||
} |
|||
|
|||
static function itemDelete($to, $id) |
|||
{ |
|||
$dom = new \DOMDocument('1.0', 'UTF-8'); |
|||
$pubsub = $dom->createElementNS('http://jabber.org/protocol/pubsub', 'pubsub'); |
|||
$retract = $dom->createElement('retract'); |
|||
$retract->setAttribute('node', 'urn:xmpp:inbox'); |
|||
$retract->setAttribute('notify', 'true'); |
|||
|
|||
$item = $dom->createElement('item'); |
|||
$item->setAttribute('id', $id); |
|||
|
|||
$retract->appendChild($item); |
|||
$pubsub->appendChild($retract); |
|||
|
|||
$xml = \Moxl\API::iqWrapper($pubsub, $to, 'set'); |
|||
\Moxl\API::request($xml); |
|||
} |
|||
} |
@ -1,61 +0,0 @@ |
|||
<?php |
|||
|
|||
namespace Moxl\Xec\Action\Notification; |
|||
|
|||
use Moxl\Xec\Action; |
|||
use Moxl\Stanza\Notification; |
|||
|
|||
use Movim\Session; |
|||
|
|||
class Get extends Action |
|||
{ |
|||
private $_to; |
|||
|
|||
public function request() |
|||
{ |
|||
$this->store(); |
|||
Notification::get($this->_to); |
|||
} |
|||
|
|||
public function setTo($to) |
|||
{ |
|||
$this->_to = $to; |
|||
return $this; |
|||
} |
|||
|
|||
public function handle($stanza, $parent = false) |
|||
{ |
|||
$session = Session::start(); |
|||
$session->set('activenotifs', []); |
|||
if($stanza->pubsub->items->item) { |
|||
foreach($stanza->pubsub->items->item as $item) { |
|||
$this->event('notification', $item); |
|||
} |
|||
|
|||
$this->event('notifications'); |
|||
} else { |
|||
$this->event('nonotification'); |
|||
} |
|||
} |
|||
|
|||
public function errorFeatureNotImplemented($stanza) |
|||
{ |
|||
$this->event('nonotification'); |
|||
} |
|||
|
|||
public function errorItemNotFound($stanza) |
|||
{ |
|||
$this->event('nonotification'); |
|||
} |
|||
|
|||
public function errorNotAuthorized($stanza) |
|||
{ |
|||
$this->event('nonotificationautorized'); |
|||
} |
|||
|
|||
public function errorNotAllowed($stanza) |
|||
{ |
|||
$this->errorItemNotFound($stanza); |
|||
} |
|||
|
|||
} |
@ -1,57 +0,0 @@ |
|||
<?php |
|||
/* |
|||
* ItemDelete.php |
|||
* |
|||
* Copyright 2012 edhelas <edhelas@edhelas-laptop> |
|||
* |
|||
* This program is free software; you can redistribute it and/or modify |
|||
* it under the terms of the GNU General Public License as published by |
|||
* the Free Software Foundation; either version 2 of the License, or |
|||
* (at your option) any later version. |
|||
* |
|||
* This program is distributed in the hope that it will be useful, |
|||
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|||
* GNU General Public License for more details. |
|||
* |
|||
* You should have received a copy of the GNU General Public License |
|||
* along with this program; if not, write to the Free Software |
|||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, |
|||
* MA 02110-1301, USA. |
|||
* |
|||
* |
|||
*/ |
|||
|
|||
namespace Moxl\Xec\Action\Notification; |
|||
|
|||
use Moxl\Xec\Action; |
|||
use Moxl\Stanza\Notification; |
|||
|
|||
class ItemDelete extends Action |
|||
{ |
|||
private $_to; |
|||
private $_id; |
|||
|
|||
public function request() |
|||
{ |
|||
$this->store(); |
|||
Notification::itemDelete($this->_to, $this->_id); |
|||
} |
|||
|
|||
public function setTo($to) |
|||
{ |
|||
$this->_to = $to; |
|||
return $this; |
|||
} |
|||
|
|||
public function setId($id) |
|||
{ |
|||
$this->_id = $id; |
|||
return $this; |
|||
} |
|||
|
|||
public function handle($stanza, $parent = false) |
|||
{ |
|||
$this->event('notificationdelete', $this->_id); |
|||
} |
|||
} |
Write
Preview
Loading…
Cancel
Save
Reference in new issue