Changeset 7748
- Timestamp:
- 01/02/07 03:45:43 (23 months ago)
- Location:
- trunk/src
- Files:
-
- 3 modified
-
gajim-remote.py (modified) (3 diffs)
-
gtkgui_helpers.py (modified) (1 diff)
-
remote_control.py (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/gajim-remote.py
r7706 r7748 229 229 ] 230 230 ], 231 'handle_uri': [ 232 _('Handle a xmpp:/ uri'), 233 [ 234 (_('uri'), _(''), True), 235 (_('account'), _(''), False) 236 ] 237 ], 238 'join_room': [ 239 _('Join a MUC room'), 240 [ 241 (_('room'), _(''), True), 242 (_('nick'), _(''), False), 243 (_('password'), _(''), False), 244 (_('account'), _(''), False) 245 ] 246 ], 247 231 248 } 232 249 if self.argv_len < 2 or \ … … 240 257 print self.compose_help().encode(PREFERRED_ENCODING) 241 258 sys.exit(0) 242 259 if self.command == 'handle_uri': 260 self.handle_uri() 243 261 self.init_connection() 244 262 self.check_arguments() … … 421 439 (args[argv_len][0], BASENAME, self.command)) 422 440 441 def handle_uri(self): 442 if not sys.argv[2:][0].startswith('xmpp:'): 443 send_error(_('Wrong uri')) 444 sys.argv[2] = sys.argv[2][5:] 445 uri = sys.argv[2:][0] 446 if not '?' in uri: 447 self.command = sys.argv[1] = 'open_chat' 448 return 449 (jid, action) = uri.split('?', 1) 450 sys.argv[2] = jid 451 if action == 'join': 452 self.command = sys.argv[1] = 'join_room' 453 return 454 455 sys.exit(0) 456 423 457 def call_remote_method(self): 424 458 ''' calls self.method with arguments from sys.argv[2:] ''' -
trunk/src/gtkgui_helpers.py
r7712 r7748 666 666 if path_to_gajim_script: 667 667 if typ == 'svn': 668 command = path_to_gajim_script + ' open_chat%s'668 command = path_to_gajim_script + ' handle_uri %s' 669 669 else: # 'installed' 670 command = 'gajim-remote open_chat%s'670 command = 'gajim-remote handle_uri %s' 671 671 672 672 # setting for GNOME/Gconf -
trunk/src/remote_control.py
r7714 r7748 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 … … 632 632 for acc in gajim.contacts.get_accounts(): 633 633 gajim.connections[acc].send_stanza(xml) 634 635 @dbus.service.method(INTERFACE) 636 def join_room(self, *args): 637 room_jid, nick, passwd, account = self._get_real_arguments(args, 4) 638 if not account: 639 # get the first connected account 640 accounts = gajim.connections.keys() 641 for acct in accounts: 642 if gajim.account_is_connected(acct): 643 account = acct 644 break 645 if not account: 646 account = gajim.contacts.get_accounts()[0] 647 print account 648 if nick is None: 649 nick = '' 650 gajim.interface.instances[account]['join_gc'] = \ 651 JoinGroupchatWindow(account, room_jid, nick) 652 else: 653 gajim.connections[account].join_gc(nick, room_jid, password)
