2012-08-27 60 views
0

我有一个使用XMPPPY向我发送消息的小程序,但是,有时在发送消息时,我只能在其中一个登录客户端上接收消息。通过gmail界面发送时,我总是会在所有登录的客户端上收到它。使用XMPPPY向所有登录的客户端发送Google Talk消息

这里是我的代码:

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的消息?

回答

相关问题