Hi !

Im' trying to hack into gajim again by adding the start_chat command
to it to popup the Start chat dialog.

My problem is that I try gajim-remote start_chat Main but nothing
happen, it just wait like this forever.

attached: my patch at current state.

--
Geobert QUACH
http://articles-ido.dnsalias.net
Index: src/remote_control.py
===================================================================
--- src/remote_control.py       (révision 6309)
+++ src/remote_control.py       (copie de travail)
@@ -171,6 +171,7 @@
                                self.remove_contact,
                                self.get_status,
                                self.get_status_message,
+                               self.start_chat,
                        ])
 
        def raise_signal(self, signal, arg):
@@ -546,6 +547,15 @@
        def get_unread_msgs_number(self, *args):
                return str(gajim.interface.roster.nb_unread)
 
+       def start_chat(self, *args):
+               [account] = self._get_real_arguments(args, 1)
+               print 'acount: ' + str(account)
+               if not account:
+                       # FIXME:  raise exception for missing argument
+                       return None
+               dialogs.NewChatDialog(account)
+               return True
+
        if dbus_support.version[1] >= 30 and dbus_support.version[1] <= 40:
                method = dbus.method
                signal = dbus.signal
@@ -575,3 +585,4 @@
        get_status_message = method(INTERFACE)(get_status_message)
        account_info = method(INTERFACE)(account_info)
        get_unread_msgs_number = method(INTERFACE)(get_unread_msgs_number)
+       start_chat = method(INTERFACE)(start_chat)
Index: src/gajim-remote.py
===================================================================
--- src/gajim-remote.py (révision 6309)
+++ src/gajim-remote.py (copie de travail)
@@ -216,6 +216,12 @@
                                _('Returns number of unreaded messages'),
                                        [ ]
                                ],
+                       'start_chat': [
+                               _('Open the start chat dialog'),
+                                       [
+                                               (_('account'), _('Account on 
which the contact is'), True)
+                                       ]
+                               ],
                        }
                if self.argv_len  < 2 or \
                        sys.argv[1] not in self.commands.keys(): # no args or 
bad args
@@ -246,7 +252,7 @@
        def print_result(self, res):
                ''' Print retrieved result to the output '''
                if res is not None:
-                       if self.command in ('open_chat', 'send_message'):
+                       if self.command in ('open_chat', 'send_message', 
'start_chat'):
                                if self.command == 'send_message':
                                        self.argv_len -= 2
                                
_______________________________________________
Gajim-devel mailing list
Gajim-devel@gajim.org
https://lists.gajim.org/cgi-bin/listinfo/gajim-devel

Reply via email to