Changeset 9873
- Timestamp:
- 07/02/08 11:20:49 (5 months ago)
- Location:
- trunk/src
- Files:
-
- 3 modified
-
chat_control.py (modified) (4 diffs)
-
common/caps.py (modified) (1 diff)
-
roster_window.py (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/chat_control.py
r9871 r9873 1075 1075 # If we don't have resource, we can't do file transfer 1076 1076 # in transports, contact holds our info we need to disable it too 1077 if NS_FILE in gajim.capscache[(contact.caps_hash_method, 1078 contact.caps_hash)].features: 1077 if gajim.capscache.is_supported(contact, NS_FILE): 1079 1078 send_file_button.set_sensitive(True) 1080 1079 else: … … 1082 1081 1083 1082 # check if it's possible to convert to groupchat 1084 if NS_MUC in gajim.capscache[(contact.caps_hash_method, 1085 contact.caps_hash)].features: 1083 if gajim.capscache.is_supported(contact, NS_MUC): 1086 1084 convert_to_gc_button.set_sensitive(True) 1087 1085 else: … … 1822 1820 # If we don't have resource, we can't do file transfer 1823 1821 # in transports, contact holds our info we need to disable it too 1824 if NS_FILE in gajim.capscache[(contact.caps_hash_method, 1825 contact.caps_hash)].features: 1822 if gajim.capscache.is_supported(contact, NS_FILE): 1826 1823 send_file_menuitem.set_sensitive(True) 1827 1824 else: … … 1829 1826 1830 1827 # check if it's possible to convert to groupchat 1831 if NS_MUC in gajim.capscache[(contact.caps_hash_method, 1832 contact.caps_hash)].features: 1828 if gajim.capscache.is_supported(contact, NS_MUC): 1833 1829 convert_to_gc_menuitem.set_sensitive(True) 1834 1830 else: -
trunk/src/common/caps.py
r9854 r9873 179 179 q.queried=1 180 180 con.discoverInfo(jid, '%s#%s' % (node, hash)) 181 182 def is_supported(self, contact, feature): 183 if not contact.resource: 184 return False 185 186 # FIXME: We assume everything is supported if we got no caps. 187 # This is the "Asterix way", after 0.12 release, I will 188 # likely implement a fallback to disco (could be disabled 189 # for mobile users who pay for traffic) 190 features = self[(contact.caps_hash_method, 191 contact.caps_hash)].features 192 if feature in features or features == []: 193 return True 194 195 return False 181 196 182 197 gajim.capscache = CapsCache(gajim.logger) -
trunk/src/roster_window.py
r9872 r9873 4885 4885 self.on_roster_treeview_row_activated, tree_path) 4886 4886 4887 if contact.resource and NS_FILE in gajim.capscache[ 4888 (contact.caps_hash_method, contact.caps_hash)].features: 4887 if gajim.capscache.is_supported(contact, NS_FILE): 4889 4888 send_file_menuitem.set_sensitive(True) 4890 4889 send_file_menuitem.connect('activate', … … 5049 5048 start_chat_menuitem.connect('activate', 5050 5049 gajim.interface.on_open_chat_window, contact, account) 5051 if contact.resource and NS_COMMANDS in gajim.capscache[ 5052 (contact.caps_hash_method, contact.caps_hash)].features: 5050 if gajim.capscache.is_supported(contact, NS_COMMANDS): 5053 5051 execute_command_menuitem.set_sensitive(True) 5054 5052 execute_command_menuitem.connect('activate', self.on_execute_command, … … 5063 5061 # Else this var is useless but harmless in next connect calls 5064 5062 5065 if contact.resource and NS_FILE in gajim.capscache[ 5066 (contact.caps_hash_method, contact.caps_hash)].features: 5063 if gajim.capscache.is_supported(contact, NS_FILE): 5067 5064 send_file_menuitem.set_sensitive(True) 5068 5065 send_file_menuitem.connect('activate', … … 5480 5477 else: # start_chat, execute_command, send_file 5481 5478 item.connect('activate', action, c, account, c.resource) 5482 if cap and cap not in gajim.capscache[5483 (c.caps_hash_method, c.caps_hash)].features:5479 if cap and \ 5480 not gajim.capscache.is_supported(c, cap): 5484 5481 item.set_sensitive(False) 5485 5482 return sub_menu … … 5517 5514 contact_list, account, self.on_invite_to_new_room, cap=NS_MUC)) 5518 5515 else: 5519 if NS_MUC in gajim.capscache[(contact.caps_hash_method, 5520 contact.caps_hash)].features: 5516 if gajim.capscache.is_supported(contact, NS_MUC): 5521 5517 invite_menuitem.set_sensitive(True) 5522 5518 invite_to_new_room_menuitem.connect('activate',
