Browse Source

Start the implementation of own presence

pull/5/head
Jaussoin Timothée 15 years ago
parent
commit
ea24d9fc84
  1. 3
      lib/XMPPConnect.php
  2. 32
      lib/widgets/Profile/Profile.php

3
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)

32
lib/widgets/Profile/Profile.php

@ -1,10 +1,10 @@
<?php
/**
* @file Friends.php
* @file Profile.php
* This file is part of MOVIM.
*
* @brief The Profilewidget
* @brief The Profile widget
*
* @author Timothée Jaussoin <edhelas_at_gmail_dot_com>
*
@ -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()
{
?>
<div id="profile">
<div id="avatar"></div>
<input type="button"
onclick="<?php $this->callAjax('ajaxRefreshVcard');?>"
value="<?php echo t('Refresh vCard'); ?>" />
</div>
<div id="profile">
<div id="avatar">
<div style="width: 60px; height: 45px; background-color: #9BBBC6;"></div>
<div id="infos"><br /></div>
</div>
<!--<select name="presence" id="presence" onchange="<?php $this->callAjax('ajaxPresence', "this.value"); ?>">
<option value="chat"><?php echo t('Online');?></option>
<option value="away"><?php echo t('Away');?></option>
<option value="dnd"><?php echo t('Do Not Disturb');?></option>
</select>-->
<input type="button"
onclick="<?php $this->callAjax('ajaxRefreshVcard');?>"
value="<?php echo t('Refresh vCard'); ?>" />
</div>
<?php
}
}

Loading…
Cancel
Save