diff --git a/app/widgets/Vcard4/Vcard4.php b/app/widgets/Vcard4/Vcard4.php index fca2ed5a0..29464304a 100644 --- a/app/widgets/Vcard4/Vcard4.php +++ b/app/widgets/Vcard4/Vcard4.php @@ -56,7 +56,6 @@ class Vcard4 extends \Movim\Widget\Base { $r = new Get; $r->setTo($this->user->id) - ->setMe() ->request(); } diff --git a/lib/moxl/src/Moxl/Stanza/Notification.php b/lib/moxl/src/Moxl/Stanza/Notification.php deleted file mode 100644 index edafa8ac1..000000000 --- a/lib/moxl/src/Moxl/Stanza/Notification.php +++ /dev/null @@ -1,36 +0,0 @@ -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); - } -} diff --git a/lib/moxl/src/Moxl/Xec/Action/Message/Composing.php b/lib/moxl/src/Moxl/Xec/Action/Message/Composing.php index d7e80b4e9..d6dceffbb 100644 --- a/lib/moxl/src/Moxl/Xec/Action/Message/Composing.php +++ b/lib/moxl/src/Moxl/Xec/Action/Message/Composing.php @@ -1,26 +1,4 @@ - * - * 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\Message; @@ -29,21 +7,14 @@ use Moxl\Stanza\Message; class Composing extends Action { - private $_to; - private $_content; - - public function request() + protected $_to; + + public function request() { Message::composing($this->_to); } - - public function setTo($to) - { - $this->_to = $to; - return $this; - } - - public function handle($stanza, $parent = false) { + public function handle($stanza, $parent = false) + { } } diff --git a/lib/moxl/src/Moxl/Xec/Action/Message/Invite.php b/lib/moxl/src/Moxl/Xec/Action/Message/Invite.php index f30489c1f..e31b98204 100644 --- a/lib/moxl/src/Moxl/Xec/Action/Message/Invite.php +++ b/lib/moxl/src/Moxl/Xec/Action/Message/Invite.php @@ -7,40 +7,16 @@ use Moxl\Stanza\Message; class Invite extends Action { - private $_to; - private $_content; - private $_id; - private $_invite; + protected $_to; + protected $_content; + protected $_id; + protected $_invite; public function request() { Message::invite($this->_to, $this->_id, $this->_invite); } - public function setTo($to) - { - $this->_to = $to; - return $this; - } - - public function setContent($content) - { - $this->_content = $content; - return $this; - } - - public function setId($id) - { - $this->_id = $id; - return $this; - } - - public function setInvite($invite) - { - $this->_invite = $invite; - return $this; - } - public function handle($stanza, $parent = false) { } diff --git a/lib/moxl/src/Moxl/Xec/Action/Message/Paused.php b/lib/moxl/src/Moxl/Xec/Action/Message/Paused.php index 1a3245100..1b28b777c 100644 --- a/lib/moxl/src/Moxl/Xec/Action/Message/Paused.php +++ b/lib/moxl/src/Moxl/Xec/Action/Message/Paused.php @@ -1,26 +1,4 @@ - * - * 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\Message; @@ -29,21 +7,14 @@ use Moxl\Stanza\Message; class Paused extends Action { - private $_to; - private $_content; - - public function request() + protected $_to; + + public function request() { Message::paused($this->_to); } - - public function setTo($to) - { - $this->_to = $to; - return $this; - } - public function handle($stanza, $parent = false) { - + public function handle($stanza, $parent = false) + { } } diff --git a/lib/moxl/src/Moxl/Xec/Action/Message/Publish.php b/lib/moxl/src/Moxl/Xec/Action/Message/Publish.php index d2d26b9d2..75783d60e 100644 --- a/lib/moxl/src/Moxl/Xec/Action/Message/Publish.php +++ b/lib/moxl/src/Moxl/Xec/Action/Message/Publish.php @@ -1,26 +1,4 @@ - * - * 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\Message; @@ -30,14 +8,14 @@ use Moxl\Stanza\Muc; class Publish extends Action { - private $_to; - private $_content; - private $_html; - private $_muc = false; - private $_encrypted = false; - private $_id = false; - private $_replace = false; - private $_file = false; + protected $_to; + protected $_content; + protected $_html; + protected $_muc = false; + protected $_encrypted = false; + protected $_id = false; + protected $_replace = false; + protected $_file = false; public function request() { @@ -51,12 +29,6 @@ class Publish extends Action } } - public function setTo($to) - { - $this->_to = $to; - return $this; - } - public function setMuc() { $this->_muc = true; @@ -68,42 +40,6 @@ class Publish extends Action return $this->_muc; } - public function setEncrypted($bool) - { - $this->_encrypted = $bool; - return $this; - } - - public function setContent($content) - { - $this->_content = $content; - return $this; - } - - public function setHTML($html) - { - $this->_html = $html; - return $this; - } - - public function setId($id) - { - $this->_id = $id; - return $this; - } - - public function setReplace($replace) - { - $this->_replace = $replace; - return $this; - } - - public function setFile($file) - { - $this->_file = $file; - return $this; - } - public function handle($stanza, $parent = false) { if($this->_muc) { diff --git a/lib/moxl/src/Moxl/Xec/Action/Microblog/CommentCreateNode.php b/lib/moxl/src/Moxl/Xec/Action/Microblog/CommentCreateNode.php index aceb107c9..6dd592ac2 100644 --- a/lib/moxl/src/Moxl/Xec/Action/Microblog/CommentCreateNode.php +++ b/lib/moxl/src/Moxl/Xec/Action/Microblog/CommentCreateNode.php @@ -1,26 +1,4 @@ - * - * 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\Microblog; @@ -29,8 +7,8 @@ use Moxl\Stanza\Pubsub; class CommentCreateNode extends Action { - private $_to; - private $_parentid; + protected $_to; + protected $_parentid; public function request() { @@ -38,18 +16,6 @@ class CommentCreateNode extends Action Pubsub::createCommentNode($this->_to, $this->_parentid); } - public function setTo($to) - { - $this->_to = $to; - return $this; - } - - public function setParentId($parentid) - { - $this->_parentid = $parentid; - return $this; - } - public function handle($stanza, $parent = false) { $this->pack(['server' => $this->_to, 'parentid' => $this->_parentid]); diff --git a/lib/moxl/src/Moxl/Xec/Action/Microblog/CommentPublish.php b/lib/moxl/src/Moxl/Xec/Action/Microblog/CommentPublish.php index 9dafccfaf..51eef6e8c 100644 --- a/lib/moxl/src/Moxl/Xec/Action/Microblog/CommentPublish.php +++ b/lib/moxl/src/Moxl/Xec/Action/Microblog/CommentPublish.php @@ -10,12 +10,12 @@ use Moxl\Xec\Action\Pubsub\GetItem; class CommentPublish extends Errors { - private $_to; - private $_node; - private $_parentid; - private $_commentnodeid; + protected $_to; + protected $_node; + protected $_parentid; + protected $_commentnodeid; - private $_atom; + protected $_atom; public function __construct() { @@ -36,12 +36,6 @@ class CommentPublish extends Errors return $this; } - public function setParentId($parentid) - { - $this->_parentid = $parentid; - return $this; - } - public function setCommentNodeId($commentnodeid) { $this->_commentnodeid = $commentnodeid; @@ -105,5 +99,4 @@ class CommentPublish extends Errors { $this->event('commentpublisherror'); } - } diff --git a/lib/moxl/src/Moxl/Xec/Action/Microblog/CommentsGet.php b/lib/moxl/src/Moxl/Xec/Action/Microblog/CommentsGet.php index 55f472b4a..f017fa6e8 100644 --- a/lib/moxl/src/Moxl/Xec/Action/Microblog/CommentsGet.php +++ b/lib/moxl/src/Moxl/Xec/Action/Microblog/CommentsGet.php @@ -7,10 +7,10 @@ use Moxl\Stanza\Pubsub; class CommentsGet extends Action { - private $_to; - private $_id; - private $_node; - private $_parentid; + protected $_to; + protected $_id; + protected $_node; + protected $_parentid; public function request() { @@ -18,12 +18,6 @@ class CommentsGet extends Action Pubsub::getItems($this->_to, $this->_node); } - public function setTo($to) - { - $this->_to = $to; - return $this; - } - public function setId($id) { $this->_id = $id; @@ -31,12 +25,6 @@ class CommentsGet extends Action return $this; } - public function setParentId($parentid) - { - $this->_parentid = $parentid; - return $this; - } - public function handle($stanza, $parent = false) { $node = (string)$stanza->pubsub->items->attributes()->node; @@ -63,5 +51,4 @@ class CommentsGet extends Action $this->pack($this->_id); $this->deliver(); } - } diff --git a/lib/moxl/src/Moxl/Xec/Action/Muc/GetConfig.php b/lib/moxl/src/Moxl/Xec/Action/Muc/GetConfig.php index a6a14400c..8b34f1525 100644 --- a/lib/moxl/src/Moxl/Xec/Action/Muc/GetConfig.php +++ b/lib/moxl/src/Moxl/Xec/Action/Muc/GetConfig.php @@ -7,7 +7,7 @@ use Moxl\Stanza\Muc; class GetConfig extends Action { - private $_to; + protected $_to; public function request() { @@ -15,12 +15,6 @@ class GetConfig extends Action Muc::getConfig($this->_to); } - public function setTo($to) - { - $this->_to = $to; - return $this; - } - public function handle($stanza, $parent = false) { $this->pack(['config' => $stanza->query, 'room' => $this->_to]); diff --git a/lib/moxl/src/Moxl/Xec/Action/Muc/SetConfig.php b/lib/moxl/src/Moxl/Xec/Action/Muc/SetConfig.php index 8f8042952..4d74ed714 100644 --- a/lib/moxl/src/Moxl/Xec/Action/Muc/SetConfig.php +++ b/lib/moxl/src/Moxl/Xec/Action/Muc/SetConfig.php @@ -7,8 +7,8 @@ use Moxl\Stanza\Muc; class SetConfig extends Action { - private $_to; - private $_data; + protected $_to; + protected $_data; public function request() { @@ -16,18 +16,6 @@ class SetConfig extends Action Muc::setConfig($this->_to, $this->_data); } - public function setTo($to) - { - $this->_to = $to; - return $this; - } - - public function setData($data) - { - $this->_data = $data; - return $this; - } - public function handle($stanza, $parent = false) { $this->deliver(); diff --git a/lib/moxl/src/Moxl/Xec/Action/Muc/SetSubject.php b/lib/moxl/src/Moxl/Xec/Action/Muc/SetSubject.php index 015779655..b23989387 100644 --- a/lib/moxl/src/Moxl/Xec/Action/Muc/SetSubject.php +++ b/lib/moxl/src/Moxl/Xec/Action/Muc/SetSubject.php @@ -7,8 +7,8 @@ use Moxl\Stanza\Muc; class SetSubject extends Action { - private $_to; - private $_subject; + protected $_to; + protected $_subject; public function request() { @@ -16,18 +16,6 @@ class SetSubject extends Action Muc::setSubject($this->_to, $this->_subject); } - public function setTo($to) - { - $this->_to = $to; - return $this; - } - - public function setSubject($subject) - { - $this->_subject = $subject; - return $this; - } - public function handle($stanza, $parent = false) { $message = \App\Message::findByStanza($stanza); diff --git a/lib/moxl/src/Moxl/Xec/Action/Nickname/Set.php b/lib/moxl/src/Moxl/Xec/Action/Nickname/Set.php index b26ba6868..ddceb8dd1 100644 --- a/lib/moxl/src/Moxl/Xec/Action/Nickname/Set.php +++ b/lib/moxl/src/Moxl/Xec/Action/Nickname/Set.php @@ -7,7 +7,7 @@ use Moxl\Stanza\Nickname; class Set extends Action { - private $_nickname; + protected $_nickname; public function request() { @@ -15,12 +15,7 @@ class Set extends Action Nickname::set($this->_nickname); } - public function setNickname($nickname) + public function handle($stanza, $parent = false) { - $this->_nickname = $nickname; - return $this; - } - - public function handle($stanza, $parent = false) { } } diff --git a/lib/moxl/src/Moxl/Xec/Action/Notification/Get.php b/lib/moxl/src/Moxl/Xec/Action/Notification/Get.php deleted file mode 100644 index c3acc4d96..000000000 --- a/lib/moxl/src/Moxl/Xec/Action/Notification/Get.php +++ /dev/null @@ -1,61 +0,0 @@ -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); - } - -} diff --git a/lib/moxl/src/Moxl/Xec/Action/Notification/ItemDelete.php b/lib/moxl/src/Moxl/Xec/Action/Notification/ItemDelete.php deleted file mode 100644 index 430541c11..000000000 --- a/lib/moxl/src/Moxl/Xec/Action/Notification/ItemDelete.php +++ /dev/null @@ -1,57 +0,0 @@ - - * - * 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); - } -} diff --git a/lib/moxl/src/Moxl/Xec/Action/Pubsub/ConfigurePersistentStorage.php b/lib/moxl/src/Moxl/Xec/Action/Pubsub/ConfigurePersistentStorage.php index 3208d16e8..724d7e78f 100644 --- a/lib/moxl/src/Moxl/Xec/Action/Pubsub/ConfigurePersistentStorage.php +++ b/lib/moxl/src/Moxl/Xec/Action/Pubsub/ConfigurePersistentStorage.php @@ -1,26 +1,4 @@ - * - * 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\Pubsub; @@ -29,10 +7,10 @@ use Moxl\Stanza\Pubsub; class ConfigurePersistentStorage extends Action { - private $_to; - private $_node; - private $_access_model; - private $_max_items; + protected $_to; + protected $_node; + protected $_access_model; + protected $_max_items; public function request() { @@ -40,18 +18,6 @@ class ConfigurePersistentStorage extends Action Pubsub::configurePersistentStorage($this->_to, $this->_node, $this->_access_model, $this->_max_items); } - public function setTo($to) - { - $this->_to = $to; - return $this; - } - - public function setNode($node) - { - $this->_node = $node; - return $this; - } - public function setAccessPresence() { $this->_access_model = 'presence'; @@ -64,19 +30,21 @@ class ConfigurePersistentStorage extends Action return $this; } - public function handle($stanza, $parent = false) { + public function handle($stanza, $parent = false) + { $this->pack($this->_node); $this->deliver(); } - public function errorFeatureNotImplemented($error) { + public function errorFeatureNotImplemented($error) + { $this->pack($this->_node); $this->deliver(); } - public function errorItemNotFound($error) { + public function errorItemNotFound($error) + { $this->pack($this->_node); $this->deliver(); } - } diff --git a/lib/moxl/src/Moxl/Xec/Action/Pubsub/Create.php b/lib/moxl/src/Moxl/Xec/Action/Pubsub/Create.php index 7f8d8afb6..c74b4dd48 100644 --- a/lib/moxl/src/Moxl/Xec/Action/Pubsub/Create.php +++ b/lib/moxl/src/Moxl/Xec/Action/Pubsub/Create.php @@ -8,9 +8,9 @@ use Moxl\Stanza\Pubsub; class Create extends Errors { - private $_to; - private $_node; - private $_name; + protected $_to; + protected $_node; + protected $_name; public function request() { @@ -18,24 +18,6 @@ class Create extends Errors Pubsub::create($this->_to, $this->_node, $this->_name); } - public function setTo($to) - { - $this->_to = $to; - return $this; - } - - public function setNode($node) - { - $this->_node = $node; - return $this; - } - - public function setName($name) - { - $this->_name = $name; - return $this; - } - public function handle($stanza, $parent = false) { if($stanza["type"] == "result"){ diff --git a/lib/moxl/src/Moxl/Xec/Action/Pubsub/CreatePersistentStorage.php b/lib/moxl/src/Moxl/Xec/Action/Pubsub/CreatePersistentStorage.php index 7e65aff88..a97041b84 100644 --- a/lib/moxl/src/Moxl/Xec/Action/Pubsub/CreatePersistentStorage.php +++ b/lib/moxl/src/Moxl/Xec/Action/Pubsub/CreatePersistentStorage.php @@ -1,26 +1,4 @@ - * - * 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\Pubsub; @@ -29,27 +7,15 @@ use Moxl\Stanza\Pubsub; class CreatePersistentStorage extends Action { - private $_to; - private $_node; - - public function request() + protected $_to; + protected $_node; + + public function request() { $this->store(); Pubsub::createPersistentStorage($this->_to, $this->_node); } - - public function setTo($to) - { - $this->_to = $to; - return $this; - } - - public function setNode($node) - { - $this->_node = $node; - return $this; - } - + public function handle($stanza, $parent = false) { $this->pack($this->_node); diff --git a/lib/moxl/src/Moxl/Xec/Action/Pubsub/Delete.php b/lib/moxl/src/Moxl/Xec/Action/Pubsub/Delete.php index 2f4d14c18..b8ceacd52 100644 --- a/lib/moxl/src/Moxl/Xec/Action/Pubsub/Delete.php +++ b/lib/moxl/src/Moxl/Xec/Action/Pubsub/Delete.php @@ -8,8 +8,8 @@ use Moxl\Stanza\Pubsub; class Delete extends Errors { - private $_to; - private $_node; + protected $_to; + protected $_node; public function request() { @@ -17,18 +17,6 @@ class Delete extends Errors Pubsub::delete($this->_to, $this->_node); } - public function setTo($to) - { - $this->_to = $to; - return $this; - } - - public function setNode($node) - { - $this->_node = $node; - return $this; - } - public function handle($stanza, $parent = false) { if($stanza["type"] == "result"){ diff --git a/lib/moxl/src/Moxl/Xec/Action/Pubsub/Errors.php b/lib/moxl/src/Moxl/Xec/Action/Pubsub/Errors.php index d458f229a..da9985cc6 100644 --- a/lib/moxl/src/Moxl/Xec/Action/Pubsub/Errors.php +++ b/lib/moxl/src/Moxl/Xec/Action/Pubsub/Errors.php @@ -1,26 +1,4 @@ - * - * 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\Pubsub; diff --git a/lib/moxl/src/Moxl/Xec/Action/Pubsub/GetAffiliations.php b/lib/moxl/src/Moxl/Xec/Action/Pubsub/GetAffiliations.php index abc817658..7a5cb91c1 100644 --- a/lib/moxl/src/Moxl/Xec/Action/Pubsub/GetAffiliations.php +++ b/lib/moxl/src/Moxl/Xec/Action/Pubsub/GetAffiliations.php @@ -1,26 +1,4 @@ _to, $this->_node); } - public function setTo($to) - { - $this->_to = $to; - return $this; - } - - public function setNode($node) - { - $this->_node = $node; - return $this; - } - public function handle($stanza, $parent = false) { $tab = []; diff --git a/lib/moxl/src/Moxl/Xec/Action/Pubsub/GetConfig.php b/lib/moxl/src/Moxl/Xec/Action/Pubsub/GetConfig.php index d1440dfc1..868434d7b 100644 --- a/lib/moxl/src/Moxl/Xec/Action/Pubsub/GetConfig.php +++ b/lib/moxl/src/Moxl/Xec/Action/Pubsub/GetConfig.php @@ -1,26 +1,4 @@ _to, $this->_node); } - public function setTo($to) - { - $this->_to = $to; - return $this; - } - - public function setNode($node) - { - $this->_node = $node; - return $this; - } - public function enableAdvanced() { $this->_advanced = true; diff --git a/lib/moxl/src/Moxl/Xec/Action/Pubsub/GetItem.php b/lib/moxl/src/Moxl/Xec/Action/Pubsub/GetItem.php index ec9ca1561..f80946e56 100644 --- a/lib/moxl/src/Moxl/Xec/Action/Pubsub/GetItem.php +++ b/lib/moxl/src/Moxl/Xec/Action/Pubsub/GetItem.php @@ -1,26 +1,4 @@ - * - * 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\Pubsub; @@ -30,12 +8,12 @@ use Moxl\Xec\Action\Pubsub\Errors; class GetItem extends Errors { - private $_to; - private $_node; - private $_id; - private $_askreply; + protected $_to; + protected $_node; + protected $_id; + protected $_askreply; - private $_parentid; + protected $_parentid; public function request() { @@ -43,36 +21,6 @@ class GetItem extends Errors Pubsub::getItem($this->_to, $this->_node, $this->_id); } - public function setTo($to) - { - $this->_to = $to; - return $this; - } - - public function setNode($node) - { - $this->_node = $node; - return $this; - } - - public function setId($id) - { - $this->_id = $id; - return $this; - } - - public function setAskReply($reply) - { - $this->_askreply = $reply; - return $this; - } - - public function setParentId($parentid) - { - $this->_parentid = $parentid; - return $this; - } - public function handle($stanza, $parent = false) { if ($stanza->pubsub->items->item) { diff --git a/lib/moxl/src/Moxl/Xec/Action/Pubsub/GetItems.php b/lib/moxl/src/Moxl/Xec/Action/Pubsub/GetItems.php index 61a3b1b2e..4ce898fd3 100644 --- a/lib/moxl/src/Moxl/Xec/Action/Pubsub/GetItems.php +++ b/lib/moxl/src/Moxl/Xec/Action/Pubsub/GetItems.php @@ -1,26 +1,4 @@ - * - * 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\Pubsub; @@ -30,14 +8,14 @@ use Moxl\Xec\Action\Pubsub\Errors; class GetItems extends Errors { - private $_to; - private $_node; - private $_since; - private $_paging; - private $_after; - private $_before; + protected $_to; + protected $_node; + protected $_since; + protected $_paging; + protected $_after; + protected $_before; - private $_paginated = false; + protected $_paginated = false; public function request() { @@ -45,24 +23,6 @@ class GetItems extends Errors Pubsub::getItems($this->_to, $this->_node, $this->_paging, $this->_after, $this->_before); } - public function setTo($to) - { - $this->_to = $to; - return $this; - } - - public function setNode($node) - { - $this->_node = $node; - return $this; - } - - public function setPaging($paging) - { - $this->_paging = $paging; - return $this; - } - public function setAfter($after) { $this->_after = $after; @@ -77,12 +37,6 @@ class GetItems extends Errors return $this; } - public function setSince($since) - { - $this->_since = $since; - return $this; - } - public function handle($stanza, $parent = false) { $ids = []; @@ -132,5 +86,4 @@ class GetItems extends Errors $this->pack(['server' => $this->_to, 'node' => $this->_node]); $this->deliver(); } - } diff --git a/lib/moxl/src/Moxl/Xec/Action/Pubsub/GetItemsId.php b/lib/moxl/src/Moxl/Xec/Action/Pubsub/GetItemsId.php index a3e3b75fe..ad2cd848c 100644 --- a/lib/moxl/src/Moxl/Xec/Action/Pubsub/GetItemsId.php +++ b/lib/moxl/src/Moxl/Xec/Action/Pubsub/GetItemsId.php @@ -9,8 +9,8 @@ use Moxl\Xec\Action\Pubsub\GetItem; class GetItemsId extends Errors { - private $_to; - private $_node; + protected $_to; + protected $_node; public function request() { @@ -18,18 +18,6 @@ class GetItemsId extends Errors Disco::items($this->_to, $this->_node); } - public function setTo($to) - { - $this->_to = $to; - return $this; - } - - public function setNode($node) - { - $this->_node = $node; - return $this; - } - public function handle($stanza, $parent = false) { $ids = []; diff --git a/lib/moxl/src/Moxl/Xec/Action/Pubsub/GetSubscriptions.php b/lib/moxl/src/Moxl/Xec/Action/Pubsub/GetSubscriptions.php index 37f575fd3..fb2014c89 100644 --- a/lib/moxl/src/Moxl/Xec/Action/Pubsub/GetSubscriptions.php +++ b/lib/moxl/src/Moxl/Xec/Action/Pubsub/GetSubscriptions.php @@ -1,26 +1,4 @@ - * - * 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\Pubsub; @@ -30,9 +8,9 @@ use Moxl\Xec\Action\Pubsub\Errors; class GetSubscriptions extends Errors { - private $_to; - private $_node; - private $_notify = true; + protected $_to; + protected $_node; + protected $_notify = true; public function request() { @@ -40,18 +18,6 @@ class GetSubscriptions extends Errors Pubsub::getSubscriptions($this->_to, $this->_node); } - public function setTo($to) - { - $this->_to = $to; - return $this; - } - - public function setNode($node) - { - $this->_node = $node; - return $this; - } - public function setNotify($notify) { $this->_notify = (bool)$notify; diff --git a/lib/moxl/src/Moxl/Xec/Action/Pubsub/PostDelete.php b/lib/moxl/src/Moxl/Xec/Action/Pubsub/PostDelete.php index d1cd70690..3037a27f7 100644 --- a/lib/moxl/src/Moxl/Xec/Action/Pubsub/PostDelete.php +++ b/lib/moxl/src/Moxl/Xec/Action/Pubsub/PostDelete.php @@ -8,9 +8,9 @@ use Moxl\Xec\Action\Pubsub\Errors; class PostDelete extends Errors { - private $_to; - private $_id; - private $_node; + protected $_to; + protected $_id; + protected $_node; public function request() { @@ -18,24 +18,6 @@ class PostDelete extends Errors Pubsub::postDelete($this->_to, $this->_node, $this->_id); } - public function setTo($to) - { - $this->_to = $to; - return $this; - } - - public function setId($id) - { - $this->_id = $id; - return $this; - } - - public function setNode($node) - { - $this->_node = $node; - return $this; - } - public function handle($stanza, $parent = false) { \App\Post::where('server', $this->_to)->where('node', $this->_node) diff --git a/lib/moxl/src/Moxl/Xec/Action/Pubsub/SetAffiliations.php b/lib/moxl/src/Moxl/Xec/Action/Pubsub/SetAffiliations.php index 8aa43bfb4..b9f4c33b3 100644 --- a/lib/moxl/src/Moxl/Xec/Action/Pubsub/SetAffiliations.php +++ b/lib/moxl/src/Moxl/Xec/Action/Pubsub/SetAffiliations.php @@ -1,26 +1,4 @@ _to, $this->_node, $this->_data); } - public function setTo($to) - { - $this->_to = $to; - return $this; - } - - public function setNode($node) - { - $this->_node = $node; - return $this; - } - - public function setData($data) - { - $this->_data = $data; - return $this; - } - public function handle($stanza, $parent = false) { $ga = new GetAffiliations; diff --git a/lib/moxl/src/Moxl/Xec/Action/Pubsub/SetConfig.php b/lib/moxl/src/Moxl/Xec/Action/Pubsub/SetConfig.php index a5d7d05ec..21aa797d1 100644 --- a/lib/moxl/src/Moxl/Xec/Action/Pubsub/SetConfig.php +++ b/lib/moxl/src/Moxl/Xec/Action/Pubsub/SetConfig.php @@ -1,26 +1,4 @@ - * - * 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\Pubsub; @@ -30,35 +8,18 @@ use Moxl\Xec\Action\Pubsub\Errors; class SetConfig extends Errors { - private $_to; - private $_node; - private $_data; - - public function request() + protected $_to; + protected $_node; + protected $_data; + + public function request() { $this->store(); Pubsub::setConfig($this->_to, $this->_node, $this->_data); } - - public function setTo($to) - { - $this->_to = $to; - return $this; - } - - public function setNode($node) - { - $this->_node = $node; - return $this; - } - - public function setData($data) + + public function handle($stanza, $parent = false) { - $this->_data = $data; - return $this; - } - - public function handle($stanza, $parent = false) { $this->deliver(); } } diff --git a/lib/moxl/src/Moxl/Xec/Action/Pubsub/SetSubscriptions.php b/lib/moxl/src/Moxl/Xec/Action/Pubsub/SetSubscriptions.php index c736ce7a7..78aa97326 100644 --- a/lib/moxl/src/Moxl/Xec/Action/Pubsub/SetSubscriptions.php +++ b/lib/moxl/src/Moxl/Xec/Action/Pubsub/SetSubscriptions.php @@ -1,26 +1,4 @@ _to, $this->_node, $this->_data); } - public function setTo($to) - { - $this->_to = $to; - return $this; - } - - public function setNode($node) - { - $this->_node = $node; - return $this; - } - - public function setData($data) - { - $this->_data = $data; - return $this; - } - public function handle($stanza, $parent = false) { $this->event('pubsubsubscriptionssubmited', $stanza); diff --git a/lib/moxl/src/Moxl/Xec/Action/Pubsub/Subscribe.php b/lib/moxl/src/Moxl/Xec/Action/Pubsub/Subscribe.php index c0dc911f0..b82d5fe48 100644 --- a/lib/moxl/src/Moxl/Xec/Action/Pubsub/Subscribe.php +++ b/lib/moxl/src/Moxl/Xec/Action/Pubsub/Subscribe.php @@ -9,10 +9,10 @@ use Moxl\Xec\Action\PubsubSubscription\Add as SubscriptionAdd; class Subscribe extends Errors { - private $_to; - private $_from; - private $_node; - private $_data; + protected $_to; + protected $_from; + protected $_node; + protected $_data; public function request() { @@ -20,30 +20,6 @@ class Subscribe extends Errors Pubsub::subscribe($this->_to, $this->_from, $this->_node); } - public function setTo($to) - { - $this->_to = $to; - return $this; - } - - public function setFrom($from) - { - $this->_from = $from; - return $this; - } - - public function setNode($node) - { - $this->_node = $node; - return $this; - } - - public function setData($data) - { - $this->_data = $data; - return $this; - } - public function handle($stanza, $parent = false) { $sa = new SubscriptionAdd; diff --git a/lib/moxl/src/Moxl/Xec/Action/Pubsub/TestCreate.php b/lib/moxl/src/Moxl/Xec/Action/Pubsub/TestCreate.php index cfb5e698d..45897c335 100644 --- a/lib/moxl/src/Moxl/Xec/Action/Pubsub/TestCreate.php +++ b/lib/moxl/src/Moxl/Xec/Action/Pubsub/TestCreate.php @@ -8,8 +8,8 @@ use Moxl\Stanza\Pubsub; class TestCreate extends Errors { - private $_to; - private $_node = 'test_node'; + protected $_to; + protected $_node = 'test_node'; public function request() { @@ -17,13 +17,8 @@ class TestCreate extends Errors Pubsub::create($this->_to, $this->_node, 'Test'); } - public function setTo($to) + public function handle($stanza, $parent = false) { - $this->_to = $to; - return $this; - } - - public function handle($stanza, $parent = false) { if($stanza["type"] == "result"){ // We delete the test node we just created Pubsub::delete($this->_to, $this->_node); @@ -34,7 +29,8 @@ class TestCreate extends Errors } } - public function error($error) { + public function error($error) + { $this->pack($this->_to); $this->deliver(); } diff --git a/lib/moxl/src/Moxl/Xec/Action/Pubsub/TestPostPublish.php b/lib/moxl/src/Moxl/Xec/Action/Pubsub/TestPostPublish.php index cd253cd2f..52e445bea 100644 --- a/lib/moxl/src/Moxl/Xec/Action/Pubsub/TestPostPublish.php +++ b/lib/moxl/src/Moxl/Xec/Action/Pubsub/TestPostPublish.php @@ -10,37 +10,25 @@ use Moxl\Xec\Action\Pubsub\Errors; class TestPostPublish extends Errors { - private $_node; - private $_to; - private $_id = 'test_post'; + protected $_node; + protected $_to; + protected $_id = 'test_post'; - public function request() + public function request() { $this->store(); Pubsub::testPostPublish($this->_to, $this->_node, $this->_id); } - - public function setTo($to) - { - $this->_to = $to; - return $this; - } - - public function setNode($node) - { - $this->_node = $node; - return $this; - } public function handle($stanza, $parent = false) { Pubsub::postDelete($this->_to, $this->_node, $this->_id); - $this->pack(array('to' => $this->_to, 'node' => $this->_node)); + $this->pack(['to' => $this->_to, 'node' => $this->_node]); $this->deliver(); } public function error($stanza, $parent = false) { - $this->pack(array('to' => $this->_to, 'node' => $this->_node)); + $this->pack(['to' => $this->_to, 'node' => $this->_node]); $this->deliver(); } } diff --git a/lib/moxl/src/Moxl/Xec/Action/Pubsub/Unsubscribe.php b/lib/moxl/src/Moxl/Xec/Action/Pubsub/Unsubscribe.php index 02194ebf5..a59ddcdbf 100644 --- a/lib/moxl/src/Moxl/Xec/Action/Pubsub/Unsubscribe.php +++ b/lib/moxl/src/Moxl/Xec/Action/Pubsub/Unsubscribe.php @@ -9,10 +9,10 @@ use Moxl\Xec\Action\PubsubSubscription\Remove as SubscriptionRemove; class Unsubscribe extends Errors { - private $_to; - private $_from; - private $_node; - private $_subid; + protected $_to; + protected $_from; + protected $_node; + protected $_subid; public function request() { @@ -20,30 +20,6 @@ class Unsubscribe extends Errors Pubsub::unsubscribe($this->_to, $this->_from, $this->_node, $this->_subid); } - public function setTo($to) - { - $this->_to = $to; - return $this; - } - - public function setFrom($from) - { - $this->_from = $from; - return $this; - } - - public function setNode($node) - { - $this->_node = $node; - return $this; - } - - public function setSubid($subid) - { - $this->_subid = $subid; - return $this; - } - public function handle($stanza, $parent = false) { $sa = new SubscriptionRemove; diff --git a/lib/moxl/src/Moxl/Xec/Action/PubsubSubscription/Add.php b/lib/moxl/src/Moxl/Xec/Action/PubsubSubscription/Add.php index d82ddaf11..cc2397ee2 100644 --- a/lib/moxl/src/Moxl/Xec/Action/PubsubSubscription/Add.php +++ b/lib/moxl/src/Moxl/Xec/Action/PubsubSubscription/Add.php @@ -8,11 +8,11 @@ use Moxl\Stanza\PubsubSubscription; class Add extends Errors { - private $_server; - private $_from; - private $_node; - private $_data; - private $_pepnode = 'urn:xmpp:pubsub:subscription'; + protected $_server; + protected $_from; + protected $_node; + protected $_data; + protected $_pepnode = 'urn:xmpp:pubsub:subscription'; public function request() { @@ -23,36 +23,6 @@ class Add extends Errors ); } - public function setServer($server) - { - $this->_server = $server; - return $this; - } - - public function setFrom($from) - { - $this->_from = $from; - return $this; - } - - public function setNode($node) - { - $this->_node = $node; - return $this; - } - - public function setPEPNode($pepnode) - { - $this->_pepnode = $pepnode; - return $this; - } - - public function setData($data) - { - $this->_data = $data; - return $this; - } - public function handle($stanza, $parent = false) { $subscription = \App\Subscription::firstOrNew([ diff --git a/lib/moxl/src/Moxl/Xec/Action/PubsubSubscription/Get.php b/lib/moxl/src/Moxl/Xec/Action/PubsubSubscription/Get.php index 80eb0bb12..0fe6db83e 100644 --- a/lib/moxl/src/Moxl/Xec/Action/PubsubSubscription/Get.php +++ b/lib/moxl/src/Moxl/Xec/Action/PubsubSubscription/Get.php @@ -8,8 +8,8 @@ use Moxl\Stanza\Pubsub; class Get extends Errors { - private $_to; - private $_pepnode = 'urn:xmpp:pubsub:subscription'; + protected $_to; + protected $_pepnode = 'urn:xmpp:pubsub:subscription'; public function request() { @@ -17,18 +17,6 @@ class Get extends Errors Pubsub::getItems($this->_to, $this->_pepnode, 1000); } - public function setTo($to) - { - $this->_to = $to; - return $this; - } - - public function setPEPNode($pepnode) - { - $this->_pepnode = $pepnode; - return $this; - } - public function handle($stanza, $parent = false) { \App\User::me()->subscriptions() diff --git a/lib/moxl/src/Moxl/Xec/Action/PubsubSubscription/Remove.php b/lib/moxl/src/Moxl/Xec/Action/PubsubSubscription/Remove.php index 1bcb0a6cd..42c12765e 100644 --- a/lib/moxl/src/Moxl/Xec/Action/PubsubSubscription/Remove.php +++ b/lib/moxl/src/Moxl/Xec/Action/PubsubSubscription/Remove.php @@ -8,10 +8,10 @@ use Moxl\Stanza\PubsubSubscription; class Remove extends Errors { - private $_server; - private $_from; - private $_node; - private $_pepnode = 'urn:xmpp:pubsub:subscription'; + protected $_server; + protected $_from; + protected $_node; + protected $_pepnode = 'urn:xmpp:pubsub:subscription'; public function request() { @@ -21,30 +21,6 @@ class Remove extends Errors ); } - public function setServer($server) - { - $this->_server = $server; - return $this; - } - - public function setFrom($from) - { - $this->_from = $from; - return $this; - } - - public function setNode($node) - { - $this->_node = $node; - return $this; - } - - public function setPEPNode($pepnode) - { - $this->_pepnode = $pepnode; - return $this; - } - public function handle($stanza, $parent = false) { if ($this->_pepnode == 'urn:xmpp:pubsub:movim-public-subscription') { diff --git a/lib/moxl/src/Moxl/Xec/Action/Roster/AddItem.php b/lib/moxl/src/Moxl/Xec/Action/Roster/AddItem.php index 0cfabeaec..fc34c2837 100644 --- a/lib/moxl/src/Moxl/Xec/Action/Roster/AddItem.php +++ b/lib/moxl/src/Moxl/Xec/Action/Roster/AddItem.php @@ -9,9 +9,9 @@ use App\User as DBUser; class AddItem extends Action { - private $_to; - private $_name; - private $_group; + protected $_to; + protected $_name; + protected $_group; public function request() { @@ -19,24 +19,6 @@ class AddItem extends Action Roster::add($this->_to, $this->_name, $this->_group); } - public function setTo($to) - { - $this->_to = $to; - return $this; - } - - public function setName($name) - { - $this->_name = $name; - return $this; - } - - public function setGroup($group) - { - $this->_group = $group; - return $this; - } - public function handle($stanza, $parent = false) { $roster = DBRoster::firstOrNew(['jid' => $this->_to]); diff --git a/lib/moxl/src/Moxl/Xec/Action/Roster/GetList.php b/lib/moxl/src/Moxl/Xec/Action/Roster/GetList.php index cec8f0b64..944183cd0 100644 --- a/lib/moxl/src/Moxl/Xec/Action/Roster/GetList.php +++ b/lib/moxl/src/Moxl/Xec/Action/Roster/GetList.php @@ -9,8 +9,6 @@ use App\User as DBUser; class GetList extends Action { - private $_from; - public function request() { $this->store(); @@ -32,7 +30,4 @@ class GetList extends Action $this->deliver(); } - - public function load($key) {} - public function save() {} } diff --git a/lib/moxl/src/Moxl/Xec/Action/Roster/RemoveItem.php b/lib/moxl/src/Moxl/Xec/Action/Roster/RemoveItem.php index 0abe40587..1e67e8367 100644 --- a/lib/moxl/src/Moxl/Xec/Action/Roster/RemoveItem.php +++ b/lib/moxl/src/Moxl/Xec/Action/Roster/RemoveItem.php @@ -7,7 +7,7 @@ use Moxl\Stanza\Roster; class RemoveItem extends Action { - private $_to; + protected $_to; public function request() { @@ -15,12 +15,6 @@ class RemoveItem extends Action Roster::remove($this->_to); } - public function setTo($to) - { - $this->_to = \echapJid($to); - return $this; - } - public function handle($stanza, $parent = false) { $contact = \App\User::me() diff --git a/lib/moxl/src/Moxl/Xec/Action/Roster/UpdateItem.php b/lib/moxl/src/Moxl/Xec/Action/Roster/UpdateItem.php index 1e14a03c6..6e5d5fd4c 100644 --- a/lib/moxl/src/Moxl/Xec/Action/Roster/UpdateItem.php +++ b/lib/moxl/src/Moxl/Xec/Action/Roster/UpdateItem.php @@ -7,10 +7,10 @@ use Moxl\Stanza\Roster; class UpdateItem extends Action { - private $_to; - private $_from; - private $_name; - private $_group; + protected $_to; + protected $_from; + protected $_name; + protected $_group; public function request() { @@ -18,24 +18,6 @@ class UpdateItem extends Action Roster::update($this->_to, $this->_name, $this->_group); } - public function setTo($to) - { - $this->_to = $to; - return $this; - } - - public function setName($name) - { - $this->_name = $name; - return $this; - } - - public function setGroup($group) - { - $this->_group = $group; - return $this; - } - public function handle($stanza, $parent = false) { $roster = \App\Roster::firstOrNew(['jid' => $this->_to]); diff --git a/lib/moxl/src/Moxl/Xec/Action/Session/Bind.php b/lib/moxl/src/Moxl/Xec/Action/Session/Bind.php index 1ddcb2ab5..b874dc68f 100644 --- a/lib/moxl/src/Moxl/Xec/Action/Session/Bind.php +++ b/lib/moxl/src/Moxl/Xec/Action/Session/Bind.php @@ -11,7 +11,7 @@ use App\Session as DBSession; class Bind extends Action { - private $_to; + protected $_resource; public function request() { @@ -19,12 +19,6 @@ class Bind extends Action Stream::bindSet($this->_resource); } - public function setResource($resource) - { - $this->_resource = $resource; - return $this; - } - public function handle($stanza, $parent = false) { $session = Session::start(); diff --git a/lib/moxl/src/Moxl/Xec/Action/Session/Start.php b/lib/moxl/src/Moxl/Xec/Action/Session/Start.php index 413a90714..851f5457b 100644 --- a/lib/moxl/src/Moxl/Xec/Action/Session/Start.php +++ b/lib/moxl/src/Moxl/Xec/Action/Session/Start.php @@ -11,7 +11,7 @@ use App\Session as DBSession; class Start extends Action { - private $_to; + protected $_to; public function request() { @@ -19,12 +19,6 @@ class Start extends Action Stream::sessionStart($this->_to); } - public function setTo($to) - { - $this->_to = $to; - return $this; - } - public function handle($stanza, $parent = false) { $session = Session::start(); diff --git a/lib/moxl/src/Moxl/Xec/Action/Storage/Get.php b/lib/moxl/src/Moxl/Xec/Action/Storage/Get.php index cc6cfae1c..f7d625610 100644 --- a/lib/moxl/src/Moxl/Xec/Action/Storage/Get.php +++ b/lib/moxl/src/Moxl/Xec/Action/Storage/Get.php @@ -1,26 +1,4 @@ - * - * 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\Storage; diff --git a/lib/moxl/src/Moxl/Xec/Action/Storage/Set.php b/lib/moxl/src/Moxl/Xec/Action/Storage/Set.php index 0c3acd3e2..494cdb4ed 100644 --- a/lib/moxl/src/Moxl/Xec/Action/Storage/Set.php +++ b/lib/moxl/src/Moxl/Xec/Action/Storage/Set.php @@ -1,26 +1,4 @@ - * - * 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\Storage; diff --git a/lib/moxl/src/Moxl/Xec/Action/Upload/Request.php b/lib/moxl/src/Moxl/Xec/Action/Upload/Request.php index 813450376..50cf360c0 100644 --- a/lib/moxl/src/Moxl/Xec/Action/Upload/Request.php +++ b/lib/moxl/src/Moxl/Xec/Action/Upload/Request.php @@ -7,10 +7,10 @@ use Moxl\Stanza\Upload; class Request extends Action { - private $_to; - private $_name; - private $_size; - private $_type; + protected $_to; + protected $_name; + protected $_size; + protected $_type; public function request() { @@ -18,38 +18,13 @@ class Request extends Action Upload::request($this->_to, $this->_name, $this->_size, $this->_type); } - public function setTo($to) + public function handle($stanza, $parent = false) { - $this->_to = echapJid($to); - return $this; - } - - public function setName($name) - { - $this->_name = $name; - return $this; - } - - public function setSize($size) - { - $this->_size = $size; - return $this; - } - - public function setType($type) - { - $this->_type = $type; - return $this; - } - - public function handle($stanza, $parent = false) { if($stanza->slot) { - $this->pack( - array( - 'get' => (string)$stanza->slot->get, - 'put' => (string)$stanza->slot->put - ) - ); + $this->pack([ + 'get' => (string)$stanza->slot->get, + 'put' => (string)$stanza->slot->put + ]); $this->deliver(); } } @@ -60,19 +35,22 @@ class Request extends Action } // the file size was too large - public function errorNotAcceptable($error) { + public function errorNotAcceptable($error) + { $this->pack($this->_to); $this->deliver(); } // the client exceeded a quota - public function errorResourceConstraint($error) { + public function errorResourceConstraint($error) + { $this->pack($this->_to); $this->deliver(); } // the client is not allowed to upload files - public function errorNotAllowed($error) { + public function errorNotAllowed($error) + { $this->pack($this->_to); $this->deliver(); } diff --git a/lib/moxl/src/Moxl/Xec/Action/Vcard/Get.php b/lib/moxl/src/Moxl/Xec/Action/Vcard/Get.php index a32bcc8a6..7e5ed7735 100644 --- a/lib/moxl/src/Moxl/Xec/Action/Vcard/Get.php +++ b/lib/moxl/src/Moxl/Xec/Action/Vcard/Get.php @@ -7,9 +7,7 @@ use Moxl\Stanza\Vcard; class Get extends Action { - private $_to; - private $_me = false; - private $_muc = false; + protected $_to; public function request() { @@ -17,24 +15,6 @@ class Get extends Action Vcard::get($this->_to); } - public function setTo($to) - { - $this->_to = $to; - return $this; - } - - public function setMe() - { - $this->_me = true; - return $this; - } - - public function isMuc() - { - $this->_muc = true; - return $this; - } - public function handle($stanza, $parent = false) { $contact = \App\Contact::firstOrNew(['id' => $this->_to]); diff --git a/lib/moxl/src/Moxl/Xec/Action/Vcard/Set.php b/lib/moxl/src/Moxl/Xec/Action/Vcard/Set.php index 7b3686512..35d8357df 100644 --- a/lib/moxl/src/Moxl/Xec/Action/Vcard/Set.php +++ b/lib/moxl/src/Moxl/Xec/Action/Vcard/Set.php @@ -1,26 +1,5 @@ - * - * 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\Vcard; use Moxl\Xec\Action; @@ -28,8 +7,8 @@ use Moxl\Stanza\Vcard; class Set extends Action { - private $_to; - private $_data; + protected $_to; + protected $_data; public function request() { @@ -37,18 +16,6 @@ class Set extends Action Vcard::set($this->_to, $this->_data); } - public function setData($data) - { - $this->_data = $data; - return $this; - } - - public function setTo($to) - { - $this->_to = $to; - return $this; - } - public function handle($stanza, $parent = false) { $this->pack($this->_to); diff --git a/lib/moxl/src/Moxl/Xec/Action/Vcard4/Get.php b/lib/moxl/src/Moxl/Xec/Action/Vcard4/Get.php index 9450926d7..9df50c701 100644 --- a/lib/moxl/src/Moxl/Xec/Action/Vcard4/Get.php +++ b/lib/moxl/src/Moxl/Xec/Action/Vcard4/Get.php @@ -1,26 +1,5 @@ - * - * 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\Vcard4; use Moxl\Xec\Action; @@ -29,8 +8,7 @@ use App\Contact; class Get extends Action { - private $_to; - private $_me = false; + protected $_to; public function request() { @@ -38,21 +16,9 @@ class Get extends Action Vcard4::get($this->_to); } - public function setTo($to) - { - $this->_to = $to; - return $this; - } - - public function setMe() - { - $this->_me = true; - return $this; - } - public function handle($stanza, $parent = false) { - if($vcard = $stanza->pubsub->items->item) { + if ($vcard = $stanza->pubsub->items->item) { $contact = \App\Contact::firstOrNew(['id' => $this->_to]); $contact->setVcard4($stanza->pubsub->items->item->vcard); $contact->save(); diff --git a/lib/moxl/src/Moxl/Xec/Action/Vcard4/Set.php b/lib/moxl/src/Moxl/Xec/Action/Vcard4/Set.php index 66789d99a..fca44d697 100644 --- a/lib/moxl/src/Moxl/Xec/Action/Vcard4/Set.php +++ b/lib/moxl/src/Moxl/Xec/Action/Vcard4/Set.php @@ -7,7 +7,7 @@ use Moxl\Stanza\Vcard4; class Set extends Action { - private $_data; + protected $_data; public function request() { @@ -15,12 +15,6 @@ class Set extends Action Vcard4::set($this->_data); } - public function setData($data) - { - $this->_data = $data; - return $this; - } - public function handle($stanza, $parent = false) { $this->pack(\App\User::me()->contact); diff --git a/lib/moxl/src/Moxl/Xec/Action/Version/Send.php b/lib/moxl/src/Moxl/Xec/Action/Version/Send.php index 074f73f9e..ecefb4939 100644 --- a/lib/moxl/src/Moxl/Xec/Action/Version/Send.php +++ b/lib/moxl/src/Moxl/Xec/Action/Version/Send.php @@ -1,26 +1,4 @@ - * - * 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\Version; @@ -29,47 +7,17 @@ use Moxl\Stanza\Version; class Send extends Action { - private $_to; - private $_id; - private $_name; - private $_version; - private $_os; + protected $_to; + protected $_id; + protected $_name; + protected $_version; + protected $_os; public function request() { Version::send($this->_to, $this->_id, $this->_name, $this->_version, $this->_os); } - public function setTo($to) - { - $this->_to = $to; - return $this; - } - - public function setId($id) - { - $this->_id = $id; - return $this; - } - - public function setName($name) - { - $this->_name = $name; - return $this; - } - - public function setVersion($version) - { - $this->_version = $version; - return $this; - } - - public function setOs($os) - { - $this->_os = $os; - return $this; - } - public function handle($stanza, $parent = false) { }