Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/jsxc.nextcloud.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'build/lib/db/iqrosterpush.php')
-rw-r--r--build/lib/db/iqrosterpush.php17
1 files changed, 16 insertions, 1 deletions
diff --git a/build/lib/db/iqrosterpush.php b/build/lib/db/iqrosterpush.php
index 1d8b596..aebf9dc 100644
--- a/build/lib/db/iqrosterpush.php
+++ b/build/lib/db/iqrosterpush.php
@@ -2,6 +2,7 @@
namespace OCA\OJSXC\Db;
+use OCA\OJSXC\AppInfo\Application;
use Sabre\Xml\Reader;
use Sabre\Xml\Writer;
use Sabre\Xml\XmlDeserializable;
@@ -13,7 +14,6 @@ use Sabre\Xml\XmlSerializable;
* Class IQRosterPush
*
* @package OCA\OJSXC\Db
- * @method void setJid($jid)
* @method void setName($name)
* @method void setSubscription($subscription)
* @method string getJid()
@@ -39,6 +39,21 @@ class IQRosterPush extends Stanza implements XmlSerializable
*/
public $subscription;
+ /**
+ * Sets the to user as a `user`.
+ *
+ * @see setFullJid
+ * @param $userId
+ * @param null $host_and_or_resource
+ */
+ public function setJid($userId, $host_and_or_resource = null)
+ {
+ $this->jid = Application::santizeUserId($userId);
+ if (!is_null($host_and_or_resource)) {
+ $this->jid .= '@' . $host_and_or_resource;
+ }
+ }
+
public function xmlSerialize(Writer $writer)
{
$writer->write([