Show
Ignore:
Timestamp:
01/06/07 12:00:50 (2 years ago)
Author:
asterix
Message:

merge changeset from trunk except pyopenssl stuff

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • branches/gajim_0.11/src/gajim-remote.py

    r7519 r7787  
    7676                                ],  
    7777                        'show_next_pending_event': [ 
    78                                         _('Popups a window with the next pending event'), 
     78                                        _('Pops up a window with the next pending event'), 
    7979                                        [] 
    8080                                ], 
    8181                        'list_contacts': [ 
    82                                         _('Prints a list of all contacts in the roster. Each contact appear on a separate line'), 
    83                                         [ 
    84                                                 (_('account'), _('show only contacts of the given account'), False) 
     82                                        _('Prints a list of all contacts in the roster. Each contact ' 
     83                                        'appears on a separate line'), 
     84                                        [ 
     85                                                (_('account'), _('show only contacts of the given account'), 
     86                                                        False) 
    8587                                        ] 
    8688 
     
    212214 
    213215                        'get_unread_msgs_number': [ 
    214                                 _('Returns number of unreaded messages'), 
     216                                _('Returns number of unread messages'), 
    215217                                        [ ] 
    216218                                ], 
     
    230232                                        ] 
    231233                                ], 
     234                        'handle_uri': [ 
     235                                        _('Handle a xmpp:/ uri'), 
     236                                        [ 
     237                                                (_('uri'), _(''), True), 
     238                                                (_('account'), _(''), False) 
     239                                        ] 
     240                                ], 
     241                        'join_room': [ 
     242                                        _('Join a MUC room'), 
     243                                        [ 
     244                                                (_('room'), _(''), True), 
     245                                                (_('nick'), _(''), False), 
     246                                                (_('password'), _(''), False), 
     247                                                (_('account'), _(''), False) 
     248                                        ] 
     249                                ], 
     250 
    232251                        } 
    233252                if self.argv_len  < 2 or \ 
     
    241260                                print self.compose_help().encode(PREFERRED_ENCODING) 
    242261                        sys.exit(0) 
    243  
     262                if self.command == 'handle_uri': 
     263                        self.handle_uri() 
    244264                self.init_connection() 
    245265                self.check_arguments() 
     
    422442                                        (args[argv_len][0], BASENAME, self.command)) 
    423443 
     444        def handle_uri(self): 
     445                if not sys.argv[2:][0].startswith('xmpp:'): 
     446                        send_error(_('Wrong uri')) 
     447                sys.argv[2] = sys.argv[2][5:] 
     448                uri = sys.argv[2:][0] 
     449                if not '?' in uri: 
     450                        self.command = sys.argv[1] = 'open_chat' 
     451                        return 
     452                (jid, action) = uri.split('?', 1) 
     453                sys.argv[2] = jid 
     454                if action == 'join': 
     455                        self.command = sys.argv[1] = 'join_room' 
     456                        return 
     457                         
     458                sys.exit(0) 
     459 
    424460        def call_remote_method(self): 
    425461                ''' calls self.method with arguments from sys.argv[2:] '''