javascript - how can change offline to online at openfire presence? -


i'm creating messenger using xmpp. did connect openfire server successfully.

console log received 'connecting' , 'connected' status, checked session on openfire admin console:

name : anonymous
resource : values
node : local
status : authenticated
presence : offline

if use spark client program, changed presence online status.

how can change that? should add more code lines?

var jid = 'id'; var pw = 'testpw'; var bosh_service = 'http://127.0.0.1:7070/http-bind/'; var connection = null;  connection = new strophe.connection(bosh_service); connection.connect(jid, pw, callback);  function callback(status){     console.log(status); } 

to declare presence status have add these lines in callback function:

if (status == strophe.status.connected) {     connection.send($pres()); } 

if need web client example based on xmpp (using strophe.js) check plunker below:

http://plnkr.co/edit/ehqhdsypdhrecmaailzo


Comments

Popular posts from this blog

Hatching array of circles in AutoCAD using c# -

ios - UITEXTFIELD InputView Uipicker not working in swift -

Python Pig Latin Translator -