我有一个使用 XMPPPY 向我发送消息的小程序,但是,有时在发送消息时,我只在一个已登录的客户端上收到它。通过 gmail 界面发送时,我总是在所有登录的客户端上收到它。
这是我的代码:
username = ''
password = ''
class Gtalk():
def send(self, recipient, message):
self.jid=xmpp.protocol.JID(username)
self.client=xmpp.Client(self.jid.getDomain())
self.connection = self.client.connect()
self.auth=self.client.auth(
self.jid.getNode(),
password,
resource=self.jid.getResource()
)
self.client.sendInitPresence(requestRoster=0)
self.client.send(xmpp.protocol.Message(
recipient, message
)
)
g = Gtalk()
g.send('', 'Hello')
有人知道如何使用出现在所有登录的 gmail 客户端上的 XMPPPY 发送消息吗?