ejabberd - Comments for "Check presence" https://www.ejabberd.im/node/757 en is there any way I can add https://www.ejabberd.im/node/757#comment-63849 <p>is there any way I can add this call to mod_xmlrpc.erl ?</p> Tue, 01 Apr 2014 12:54:37 +0000 digitaldude comment 63849 at https://www.ejabberd.im xmlrpc:call({127,0,0,1}, https://www.ejabberd.im/node/757#comment-63848 <p>xmlrpc:call({127,0,0,1}, 4560, "/", {call, get_presence,<br /> [{struct, [{user, "jenkins"}, {server, "localhost"}]}]}).</p> <p>using ejabberd 2.1.13 and latest mod_xmlrpc from svn does not work. I get Unknown Call.<br /> But create_account works...</p> Tue, 01 Apr 2014 12:53:11 +0000 digitaldude comment 63848 at https://www.ejabberd.im I would also like to see this https://www.ejabberd.im/node/757#comment-55307 <p>I would also like to see this added</p> Thu, 18 Feb 2010 13:00:37 +0000 leeb comment 55307 at https://www.ejabberd.im Thanks, I've fixed the code https://www.ejabberd.im/node/757#comment-2143 <p>Thanks, I've fixed the code and released a new revision.</p> Tue, 15 Aug 2006 07:57:18 +0000 mfoss comment 2143 at https://www.ejabberd.im get status via xmlrpc https://www.ejabberd.im/node/757#comment-2140 <p>is it also possible to get the status of a user via xmlrpc?</p> <p>ejabberd_c2s has a function called get_presence but i have no idea how to call it correctly or combine it with mod_xmlrpc. the function needs (eats) a FsmRef-variable. is it possible to use this function with mod_xmlrpc? if not, where would be a good place to look for a handler for status messages in the sources of ejabberd? best would be a function like get_status(User, Server) :)</p> <p>thanks a lot.</p> <p>flip</p> Mon, 14 Aug 2006 20:17:54 +0000 flipkick comment 2140 at https://www.ejabberd.im error in recource_num of mod_xmlrpc https://www.ejabberd.im/node/757#comment-2139 <p>the function resource_num didn't work for me due to a wrong comparison in the source (line 4):</p> <pre>% resource_num struct[{user, String}, {host, String}, {num, Integer}] String handler(_State, {call, resource_num, [{struct, [{user, U}, {host, H}, {num, N}]}]}) -&gt; Resources = ejabberd_sm:get_user_resources(U, H), case (0&gt;N) and (N&gt;=length(Resources)) of true -&gt; R = lists:nth(N, Resources), {false, {response, [R]}}; false -&gt; FaultString = lists:flatten(io_lib:format("Wrong resource number: ~p", [N])), {false, {response, {fault, -1, FaultString}}} end;</pre><p> this works, after changing line 4:</p> <pre>% resource_num struct[{user, String}, {host, String}, {num, Integer}] String handler(_State, {call, resource_num, [{struct, [{user, U}, {host, H}, {num, N}]}]}) -&gt; Resources = ejabberd_sm:get_user_resources(U, H), case (N&gt;0) and (length(Resources)&gt;=N) of true -&gt; R = lists:nth(N, Resources), {false, {response, [R]}}; false -&gt; FaultString = lists:flatten(io_lib:format("Wrong resource number: ~p", [N])), {false, {response, {fault, -1, FaultString}}} end;</pre><p> flip</p> Mon, 14 Aug 2006 18:57:10 +0000 flipkick comment 2139 at https://www.ejabberd.im ok,It is work. https://www.ejabberd.im/node/757#comment-1575 <p>ok,It is work.<br /> Thank you very much badlop.</p> <p>Using this I create a call that return "offline" or an array with the resources that is connected a user. </p> <pre>handler(_State, {call, resources, [{struct, [{user, U}, {host, H}]}]}) -&gt; Resources = ejabberd_sm:get_user_resources(U, H), case (length(Resources)&gt;0) of true -&gt; {false, {response, [{array, Resources}]}}; false -&gt; {false, {response, ["offline"]}} end;</pre> Mon, 17 Apr 2006 15:12:33 +0000 ppcharli comment 1575 at https://www.ejabberd.im No, you don't. Reload. https://www.ejabberd.im/node/757#comment-1573 <p>No, you don't. Reload in your web browser.</p> Mon, 17 Apr 2006 09:34:35 +0000 mfoss comment 1573 at https://www.ejabberd.im Where I get the new version https://www.ejabberd.im/node/757#comment-1572 <p>Where I get the new version of mod_xmlrpc, in "http://www.ejabberd.im/files/efiles/mod_xmlrpc.erl" I get the old.<br /> Thanks</p> Mon, 17 Apr 2006 08:34:41 +0000 ppcharli comment 1572 at https://www.ejabberd.im Net::XMPP https://www.ejabberd.im/node/757#comment-1571 <p>You can use Net::XMPP package within Perl</p> <p>use Net::XMPP;</p> <p>my $client = new Net::XMPP::Client();<br /> my $roster = $client-&gt;Roster();<br /> if ($roster-&gt;online('john.doe@jabber.org')<br /> {<br /> CODE GOES HERE<br /> }</p> <p>my @resource = $roster-&gt;resources('john.doe@jabber.org');<br /> OR<br /> my $resource = $roster-&gt;resource('john.doe@jabber.org');</p> <p>Check documentation for Net::XMPP how to connect to jabber server.</p> Mon, 17 Apr 2006 07:53:10 +0000 taskovskig comment 1571 at https://www.ejabberd.im Check the new mod_xmlrpc 0.2.0 https://www.ejabberd.im/node/757#comment-1570 <p>I've just published a new version of mod_xmlrpc with two new calls:</p> <ul> <li>'num_resources USER HOST': reports the number of online resources for a user. If he is offline: 0, if he is online: 1, if he is logged with two clients: 2. </li><li>'resource_num USER HOST NUM': it tells you the resource name in position NUM. If num_resources reports you '2', you can now ask resource names 1 and 2. </li></ul> <p>I haven't tried this, but I hope it'll work.</p> Sun, 16 Apr 2006 17:28:24 +0000 mfoss comment 1570 at https://www.ejabberd.im How I can call mod_xmlrpc to https://www.ejabberd.im/node/757#comment-1568 <p>How I can call mod_xmlrpc to get presence(offline or online and resource). In mod_xmlrpc.txt documentation I do not view this call.<br /> Thanks</p> Fri, 14 Apr 2006 18:43:18 +0000 ppcharli comment 1568 at https://www.ejabberd.im Yes, mod_xmlrpc can be https://www.ejabberd.im/node/757#comment-1567 <p>Yes, you can add that call to <noindex><a href="/mod_xmlrpc" rel="nofollow" >mod_xmlrpc</a></noindex> and query it using a XML-RPC client.</p> Fri, 14 Apr 2006 17:44:56 +0000 mfoss comment 1567 at https://www.ejabberd.im