Ticket #2133: gajim.fix2133.patch
| File gajim.fix2133.patch, 3.2 kB (added by misc, 2 years ago) |
|---|
-
src/remote_control.py
21 21 from common import gajim 22 22 from common import helpers 23 23 from time import time 24 from dialogs import AddNewContactWindow, NewChatDialog 24 from dialogs import AddNewContactWindow, NewChatDialog, JoinGroupchatWindow 25 25 26 26 from common import dbus_support 27 27 if dbus_support.supported: … … 568 568 else: 569 569 for acc in gajim.contacts.get_accounts(): 570 570 gajim.connections[acc].send_stanza(xml) 571 572 @dbus.service.method(INTERFACE) 573 def join_room(self, *args): 574 room_jid, nick, passwd, account = self._get_real_arguments(args, 4) 575 if not account: 576 # maybe use the first non local account 577 account = gajim.contacts.get_accounts()[0] 578 if nick is None: 579 nick = '' 580 gajim.interface.instances[account]['join_gc'] = \ 581 JoinGroupchatWindow(account, room_jid, nick) 582 else: 583 gajim.connections[account].join_gc(nick, room_jid, password) -
src/gajim-remote.py
229 229 False) 230 230 ] 231 231 ], 232 'handle_uri': [ 233 _('Handle a xmpp:/ uri'), 234 [ 235 (_('uri'), _(''), True), 236 (_('account'), _(''), False) 237 ] 238 ], 239 'join_room': [ 240 _('Join a MUC room'), 241 [ 242 (_('room'), _(''), True), 243 (_('nick'), _(''), False), 244 (_('password'), _(''), False), 245 (_('account'), _(''), False) 246 ] 247 ], 248 232 249 } 233 250 if self.argv_len < 2 or \ 234 251 sys.argv[1] not in self.commands.keys(): # no args or bad args … … 240 257 else: 241 258 print self.compose_help().encode(PREFERRED_ENCODING) 242 259 sys.exit(0) 243 260 if self.command == 'handle_uri': 261 self.handle_uri() 244 262 self.init_connection() 245 263 self.check_arguments() 246 264 … … 421 439 'Type "%s help %s" for more info') % 422 440 (args[argv_len][0], BASENAME, self.command)) 423 441 442 def handle_uri(self): 443 if not sys.argv[2:][0].startswith('xmpp:'): 444 send_error(_('Wrong uri')) 445 sys.argv[2] = sys.argv[2][5:] 446 uri = sys.argv[2:][0] 447 if not '?' in uri: 448 self.command = sys.argv[1] = 'open_chat' 449 return 450 (jid, action) = uri.split('?', 1) 451 if action == 'join': 452 self.command = sys.argv[1] = 'join_room' 453 return 454 455 sys.exit(0) 456 424 457 def call_remote_method(self): 425 458 ''' calls self.method with arguments from sys.argv[2:] ''' 426 459 args = sys.argv[2:] -
src/gtkgui_helpers.py
607 607 path_to_gajim_script, typ = get_abspath_for_script('gajim-remote', True) 608 608 if path_to_gajim_script: 609 609 if typ == 'svn': 610 command = path_to_gajim_script + ' open_chat%s'610 command = path_to_gajim_script + ' handle_uri %s' 611 611 else: # 'installed' 612 command = 'gajim-remote open_chat%s'612 command = 'gajim-remote handle_uri %s' 613 613 614 614 # setting for GNOME/Gconf 615 615 client.set_bool('/desktop/gnome/url-handlers/xmpp/enabled', True)
