Here is my code开发者_Go百科:
require 'xmpp4r/client'
jid = Jabber::JID::new('some.other@gmail.com/Home')
cl = Jabber::Client::new(jid)
cl.connect
cl.auth('pass')
cl.send(Jabber::Presence.new.set_show(:chat).set_status('my_status'))
#cl.send Jabber::Presence::new
salutation = Jabber::Message::new( 'here.again@gmail.com', '' )
salutation.set_type(:chat).set_id('1')
cl.send salutation
while 1
end
But when I close chat window jabber-bot goes offline. How can I keep it online?
精彩评论