问题
I would like to add support of ICQ in my application using jabber-transport. I use xmpp4r ruby's library.
All that I found doesn't show how to login to external (icq) server and how to send messages.
Can you show example of code or text explanation how to do so? (may be not using xmpp4r and ruby, I only need a hint.)
回答1:
I found solution thanks to canhaschat plugin source code
require 'xmpp4r'
#connect to jabber
jid=Jabber::JID.new "your_jid"
client=Jabber::Client.new jid
client.connect
client.auth "your_jabber_password"
#connect to transport
reg=Jabber::Iq.new_register "your_login (e.g 123456789)", "your_password (e.g. qwerty)"
reg.to="transport server url (e.g. icq.udaff.com)"
client.send reg
#send message
client.send Jabber::Message.new "recipient_login@transport", "Hi there!"
#end of work...
client.close
来源:https://stackoverflow.com/questions/4292482/xmpp-transport-to-another-protocol