From ea24d9fc84b3e080abd52e900bcb7d5cc2f546a3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jaussoin=20Timoth=C3=A9e?= Date: Mon, 28 Feb 2011 22:16:38 +0100 Subject: [PATCH] Start the implementation of own presence --- lib/XMPPConnect.php | 3 ++- lib/widgets/Profile/Profile.php | 32 ++++++++++++++++++++++++-------- 2 files changed, 26 insertions(+), 9 deletions(-) diff --git a/lib/XMPPConnect.php b/lib/XMPPConnect.php index 78b14b2b5..a57095e91 100644 --- a/lib/XMPPConnect.php +++ b/lib/XMPPConnect.php @@ -293,7 +293,8 @@ class XMPPConnect */ public function setStatus($status, $show) { - $this->jaxl->setStatus($status, $show, 40, true); + define('CURL_ASYNC', true); + $this->jaxl->setStatus($status, $show, 41, true); } private function checkJid($jid) diff --git a/lib/widgets/Profile/Profile.php b/lib/widgets/Profile/Profile.php index c069162a8..9fbc00631 100644 --- a/lib/widgets/Profile/Profile.php +++ b/lib/widgets/Profile/Profile.php @@ -1,10 +1,10 @@ * @@ -22,6 +22,7 @@ class Profile extends Widget function WidgetLoad() { $this->addcss('profile.css'); + $this->addjs('profile.js'); $this->registerEvent('vcardreceived', 'onVcardReceived'); } @@ -41,16 +42,31 @@ class Profile extends Widget $xmpp = XMPPConnect::getInstance($user->getLogin()); $xmpp->getVCard(); // We send the vCard request } + + function ajaxPresence($presence) + { + $user = new User(); + $xmpp = XMPPConnect::getInstance($user->getLogin()); + $xmpp->setStatus(false, $presence); + } function build() { ?> -
-
- -
+
+
+
+

+
+ + +