[ejabberd] Change jabber users Presence externally from another application

duane.larson at gmail.com duane.larson at gmail.com
Wed Aug 1 01:00:06 MSK 2012


No I am using addresses that are set up on an ejabberd server.

ClientA is a Pidgin client
ClientB is a Psi client

With the Jaxl library I send the following

public static function sendSharedOnPhone($jaxl, $to) {
$xml = "";
$xml .= "<iq type='set' to='" . $to . "/Work' id='ss-2'>";
$xml .= "<query xmlns='google:shared-status' version='2'>";
$xml .= "<status>On Phone</status>";
$xml .= "<show>dnd</show>";
$xml .= "<status-list show='dnd'>";
$xml .= "<status>On Phone</status>";
$xml .= "</status-list>";
$xml .= "<status-list show='default'>";
$xml .= "<status>I'm Here</status>";
$xml .= "</status-list>";
$xml .= "<invisible value='false'/>";
$xml .= "</query>";
$xml .= "</iq>";

$jaxl->sendXML($xml);

}

When that gets sent the Psi client shows that Buddy ClientA is "On Phone"  
and the icon is a "dnd" icon. The Pidgin client for ClientA automatically  
has its presence set to On phone and dnd.

Then when I am ready I send the following

public static function sendSharedAvail($jaxl, $to) {
$xml = "";
$xml .= "<iq type='set' to='" . $to . "/Work' id='ss-2'>";
$xml .= "<query xmlns='google:shared-status' version='3'>";
$xml .= "<status>Available</status>";
$xml .= "<show>default</show>";
$xml .= "<status-list show='default'>";
$xml .= "<status>I'm Here</status>";
$xml .= "</status-list>";
$xml .= "<status-list show='dnd'>";
$xml .= "<status>On Phone</status>";
$xml .= "</status-list>";
$xml .= "<invisible value='false'/>";
$xml .= "</query>";
$xml .= "</iq>";

$jaxl->sendXML($xml);

}


And everything is back to normal.

This works with Pidgin is ClientA. If Psi is ClientA then it won't work  
because Psi doesn't have a google shared status plugin.

On , Kirk Bateman <kirk.bateman at gmail.com> wrote:
> Duane,
> Glad you got something working, I'm assuming you tested using gmail  
> addresses as I can only see any client side functionality mentioned so  
> far.
> I'm looking at what is involved to implement the server side support for  
> shared-status functionality, it doesn't look too much work so far.
> Regards
> Kirk

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.jabber.ru/pipermail/ejabberd/attachments/20120731/d3de1c97/attachment.html>


More information about the ejabberd mailing list