Changeset 8711 for branches/gajim_0.11.1/src/common
- Timestamp:
- 09/04/07 21:01:00 (15 months ago)
- Location:
- branches/gajim_0.11.1/src/common
- Files:
-
- 2 modified
-
connection_handlers.py (modified) (3 diffs)
-
connection.py (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/gajim_0.11.1/src/common/connection_handlers.py
r8709 r8711 797 797 self.vcard_shas = {} # sha of contacts 798 798 self.room_jids = [] # list of gc jids so that vcard are saved in a folder 799 self.groupchat_jids = {} # {ID : groupchat_jid} 800 799 801 800 def add_sha(self, p, send_caps = True): 802 801 c = p.setTag('x', namespace = common.xmpp.NS_VCARD_UPDATE) … … 1300 1299 except: 1301 1300 return 1302 who = helpers.get_full_jid_from_iq(iq_obj) 1301 id = iq_obj.getID() 1302 if id in self.groupchat_jids: 1303 who = self.groupchat_jids[id] 1304 del self.groupchat_jids[id] 1305 else: 1306 who = helpers.get_full_jid_from_iq(iq_obj) 1303 1307 jid_stripped, resource = gajim.get_room_and_nick_from_fjid(who) 1304 1308 self.dispatch('LAST_STATUS_TIME', (jid_stripped, resource, seconds, status)) … … 1315 1319 if qp.getTag('os'): 1316 1320 os_info += qp.getTag('os').getData() 1317 who = helpers.get_full_jid_from_iq(iq_obj) 1321 id = iq_obj.getID() 1322 if id in self.groupchat_jids: 1323 who = self.groupchat_jids[id] 1324 del self.groupchat_jids[id] 1325 else: 1326 who = helpers.get_full_jid_from_iq(iq_obj) 1318 1327 jid_stripped, resource = gajim.get_room_and_nick_from_fjid(who) 1319 1328 self.dispatch('OS_INFO', (jid_stripped, resource, client_info, os_info)) -
branches/gajim_0.11.1/src/common/connection.py
r8683 r8711 80 80 # Do we continue connection when we get roster (send presence,get vcard...) 81 81 self.continue_connect_info = None 82 # To know the groupchat jid associated with a sranza ID. Useful to 83 # request vcard or os info... to a real JID but act as if it comes from 84 # the fake jid 85 self.groupchat_jids = {} # {ID : groupchat_jid} 82 86 if USE_GPG: 83 87 self.gpg = GnuPG.GnuPG(gajim.config.get('use_gpg_agent')) … … 905 909 self.name = new_name 906 910 907 def request_last_status_time(self, jid, resource): 911 def request_last_status_time(self, jid, resource, groupchat_jid=None): 912 '''groupchat_jid is used when we want to send a request to a real jid 913 and act as if the answer comes from the groupchat_jid''' 908 914 if not self.connection: 909 915 return … … 913 919 iq = common.xmpp.Iq(to = to_whom_jid, typ = 'get', queryNS =\ 914 920 common.xmpp.NS_LAST) 915 self.connection.send(iq) 916 917 def request_os_info(self, jid, resource): 921 id = self.connection.getAnID() 922 iq.setID(id) 923 if groupchat_jid: 924 self.groupchat_jids[id] = groupchat_jid 925 self.connection.send(iq) 926 927 def request_os_info(self, jid, resource, groupchat_jid=None): 928 '''groupchat_jid is used when we want to send a request to a real jid 929 and act as if the answer comes from the groupchat_jid''' 918 930 if not self.connection: 919 931 return … … 927 939 iq = common.xmpp.Iq(to = to_whom_jid, typ = 'get', queryNS =\ 928 940 common.xmpp.NS_VERSION) 941 id = self.connection.getAnID() 942 iq.setID(id) 943 if groupchat_jid: 944 self.groupchat_jids[id] = groupchat_jid 929 945 self.connection.send(iq) 930 946
