[ejabberd] Exmpp bot jabber client autorization

Alexander Kuleshov kuleshovmail at gmail.com
Fri May 20 20:27:59 MSD 2011


2011/5/20 kael <ka-el at laposte.net>:
> On 05/20/2011 09:09 AM, Alexander Kuleshov wrote:
>>
>> Hello,
>
> Hello,
>
>> I run echo client
>> (https://github.com/processone/exmpp/blob/master/examples/echo_client.erl)
>> It works. But when i add it to roster it's offline. Why?
>
> In echo_client:loop/1, the second clause handles only <message/>, and the
> third one handles other packets which are just print in the console.
>
>> How can i make online status for it?
>
> You need to add, in echo_client:loop/1, a clause to handle presence packets
> :
>
> Record = #received_packet{packet_type = presence},
>
> And to send a presence back to the contact.
>
>
> I've attached a modified version of echo_client.erl which handles presence
> and presence subscription, and maintains a list of online contacts.
>
> See this tutorial
> <https://support.process-one.net/doc/display/EXMPP/Scalable+XMPP+bots+with+erlang+and+exmpp>.
>
> And the "sub2text" bot which is a great example of an exmpp bot using
> gen_server <https://github.com/astro/sub2text> and specially
> <https://github.com/astro/sub2text/blob/68ae223756532315108c826888618003c6ea25b0/src/client.erl>.
>
> --
> kael
>
> _______________________________________________
> ejabberd mailing list
> ejabberd at jabber.ru
> http://lists.jabber.ru/mailman/listinfo/ejabberd
>
>

Thank you very much.


More information about the ejabberd mailing list