comparison src/core/xmpp.py @ 742:03744d9ebc13

plugin XEP-0033: implementation of the addressing feature: - frontends pass the recipients in the extra parameter of sendMessage - backend checks if the target server supports the feature (this is not done yet by prosody plugin) - features and identities are cached per profile and server - messages are duplicated in history for now (TODO: redesign the database) - echos signals are also duplicated to the sender (FIXME)
author souliane <souliane@mailoo.org>
date Wed, 11 Dec 2013 17:16:53 +0100
parents b26dfac8e46c
children bfabeedbf32e
comparison
equal deleted inserted replaced
741:00318e60a06a 742:03744d9ebc13
73 73
74 self.roster.requestRoster() 74 self.roster.requestRoster()
75 75
76 self.presence.available() 76 self.presence.available()
77 77
78 self.disco.requestInfo(jid.JID(self.jid.host)).addCallback(self.host_app.serverDisco, self.profile) # FIXME: use these informations 78 jid_ = self.getHostJid()
79 79 self.disco.requestInfo(jid_).addCallback(self.host_app.serverDisco, jid_, self.profile) # FIXME: use these informations
80 self.disco.requestItems(jid.JID(self.jid.host)).addCallback(self.host_app.serverDiscoItems, self.disco, self.profile, self.client_initialized) 80
81 self.disco.requestItems(jid_).addCallback(self.host_app.serverDiscoItems, self.disco, jid_, self.profile, self.client_initialized)
81 self.conn_deferred.callback(None) 82 self.conn_deferred.callback(None)
82 83
83 def initializationFailed(self, reason): 84 def initializationFailed(self, reason):
84 print "initializationFailed: %s" % reason 85 print "initializationFailed: %s" % reason
85 self.host_app.bridge.connectionError("AUTH_ERROR", self.profile) 86 self.host_app.bridge.connectionError("AUTH_ERROR", self.profile)
100 self.keep_alife.stop() 101 self.keep_alife.stop()
101 except AttributeError: 102 except AttributeError:
102 debug(_("No keep_alife")) 103 debug(_("No keep_alife"))
103 self.host_app.bridge.disconnected(self.profile) # we send the signal to the clients 104 self.host_app.bridge.disconnected(self.profile) # we send the signal to the clients
104 self.host_app.purgeClient(self.profile) # and we remove references to this client 105 self.host_app.purgeClient(self.profile) # and we remove references to this client
106
107 def getHostJid(self):
108 """@return: the jid of the local server"""
109 return jid.JID(self.jid.host)
105 110
106 111
107 class SatMessageProtocol(xmppim.MessageProtocol): 112 class SatMessageProtocol(xmppim.MessageProtocol):
108 113
109 def __init__(self, host): 114 def __init__(self, host):