Changeset 9123 for branches/pep/src/common/commands.py
- Timestamp:
- 12/12/07 09:44:46 (12 months ago)
- Files:
-
- 1 modified
-
branches/pep/src/common/commands.py (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/pep/src/common/commands.py
r8478 r9123 2 2 ## Copyright (C) 2006 Gajim Team 3 3 ## 4 ## This program is free software; you can redistribute it and/or modify 4 ## This file is part of Gajim. 5 ## 6 ## Gajim is free software; you can redistribute it and/or modify 5 7 ## it under the terms of the GNU General Public License as published 6 ## by the Free Software Foundation; version 2only.7 ## 8 ## This program is distributed in the hope that it will be useful,8 ## by the Free Software Foundation; version 3 only. 9 ## 10 ## Gajim is distributed in the hope that it will be useful, 9 11 ## but WITHOUT ANY WARRANTY; without even the implied warranty of 10 12 ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 13 ## GNU General Public License for more details. 14 ## 15 ## You should have received a copy of the GNU General Public License 16 ## along with Gajim. If not, see <http://www.gnu.org/licenses/>. 12 17 ## 13 18 … … 163 168 class LeaveGroupchatsCommand(AdHocCommand): 164 169 commandnode = 'leave-groupchats' 165 commandname = 'Leave Groupchats'170 commandname = _('Leave Groupchats') 166 171 167 172 @staticmethod … … 289 294 jid = helpers.get_full_jid_from_iq(iq_obj) 290 295 q = iq.getTag('query') 296 # buildReply don't copy the node attribute. Re-add it 297 q.setAttr('node', xmpp.NS_COMMANDS) 291 298 292 299 for node, cmd in self.__commands.iteritems(): … … 300 307 self.connection.send(iq) 301 308 302 def command Query(self, con, iq_obj):303 ''' Send disco result for query for command (JEP-0050, example 6.).309 def commandInfoQuery(self, con, iq_obj): 310 ''' Send disco#info result for query for command (JEP-0050, example 6.). 304 311 Return True if the result was sent, False if not. ''' 305 312 jid = helpers.get_full_jid_from_iq(iq_obj) … … 319 326 q.addChild('feature', attrs = {'var': feature}) 320 327 328 self.connection.send(iq) 329 return True 330 331 return False 332 333 def commandItemsQuery(self, con, iq_obj): 334 ''' Send disco#items result for query for command. 335 Return True if the result was sent, False if not. ''' 336 jid = helpers.get_full_jid_from_iq(iq_obj) 337 node = iq_obj.getTagAttr('query', 'node') 338 339 if node not in self.__commands: return False 340 341 cmd = self.__commands[node] 342 if cmd.isVisibleFor(self.isSameJID(jid)): 343 iq = iq_obj.buildReply('result') 321 344 self.connection.send(iq) 322 345 return True
