[ejabberd] Change jabber users Presence externally from another application

Kirk Bateman kirk.bateman at gmail.com
Wed Aug 1 01:07:35 MSK 2012


Duane,

OK, the XML looks wrong but hey it works :-)

The status-list elements look to be missing start elements ? Is anything
rebroadcasting the normal <presence> message after you sendSharedOnPhone ?
Or are you using that as direct presence to each client ? (Try with more
clients, you should only have to send the IQ once and the server should
handle updating presence to the clients)

Good start though.

Cheers

Kirk
On 31 Jul 2012 22:00, <duane.larson at gmail.com> wrote:

> 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
> >
> _______________________________________________
> ejabberd mailing list
> ejabberd at jabber.ru
> http://lists.jabber.ru/mailman/listinfo/ejabberd
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.jabber.ru/pipermail/ejabberd/attachments/20120731/4c884c36/attachment.html>


More information about the ejabberd mailing list