【问题标题】:Setting Gtalk Status with Jabber使用 Jabber 设置 Gtalk 状态
【发布时间】:2011-05-21 01:53:14
【问题描述】:

我正在使用 Jabber 与 gTalk 服务器进行通信。现在,我可以正常连接。此外,我可以发送/接收消息。但是,我无法通过jabber.status 方法将我的 gtalk 状态设置为忙碌

require 'rubygems'
require 'xmpp4r-simple'

include Jabber
#Jabber::debug = true

jid = 'user@gmail.com'
pass = 'password'

jabber = Simple.new(jid, pass)
jabber.status(:dnd, 'password')  
jabber.deliver('user2@gmail.com','away')

你能建议我哪里出错了吗? 谢谢。

【问题讨论】:

    标签: ruby-on-rails ruby xmpp google-talk xmpp4r


    【解决方案1】:

    应该可以,但请注意

    jabber.status(:dnd, 'password')
    

    会将您的状态设置为密码,这是个坏主意。

    您确定您最初已登录吗?如果是这样:

    jabber.connected?
    

    应该返回 true。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2011-01-29
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多