使用 Jabber 设置 Gtalk 状态
我正在使用 Jabber 与 gTalk 服务器进行通信。现在,我可以正确连接。另外,我可以发送/接收消息。但是,我无法通过 jabber.status
方法将我的 gtalk 状态设置为忙碌,
require 'rubygems'
require 'xmpp4r-simple'
include Jabber
#Jabber::debug = true
jid = '[email protected]'
pass = 'password'
jabber = Simple.new(jid, pass)
jabber.status(:dnd, 'password')
jabber.deliver('[email protected]','away')
您能建议我哪里出错了吗? 谢谢。
I'm using Jabber to communicate with gTalk server. Right now, I'm able to connect properly. Also, I can send/receive messages. But, I'm unable to set my gtalk presence as busy though jabber.status
method
require 'rubygems'
require 'xmpp4r-simple'
include Jabber
#Jabber::debug = true
jid = '[email protected]'
pass = 'password'
jabber = Simple.new(jid, pass)
jabber.status(:dnd, 'password')
jabber.deliver('[email protected]','away')
Can you suggest where am I going wrong?
Thanks.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这应该可行,但请注意,这
会将您的状态设置为密码,这是一个坏主意。
您确定您最初已登录吗?如果是这样:
应该返回 true。
That should work, but note that
will set your status to password, which is a bad idea.
Are you sure you're logged on initially? If so:
should return true.