changeset 1eb1facb0e21 in /home/hg/repos/gajim

details:http://hg.gajim.org/gajim?cmd=changeset;node=1eb1facb0e21
description: allow to not specify status in gajim-remote change_status to 
change only status message. Fixes #5039

diffstat:

 src/gajim-remote.py   |   2 +-
 src/remote_control.py |  16 +++++++++++++---
 2 files changed, 14 insertions(+), 4 deletions(-)

diffs (47 lines):

diff -r 50c1a5f0a005 -r 1eb1facb0e21 src/gajim-remote.py
--- a/src/gajim-remote.py       Thu Jan 14 15:50:21 2010 +0100
+++ b/src/gajim-remote.py       Thu Jan 14 21:16:13 2010 +0100
@@ -106,7 +106,7 @@
                                        _('Changes the status of account or 
accounts'),
                                        [
 #offline, online, chat, away, xa, dnd, invisible should not be translated
-                                               (_('status'), _('one of: 
offline, online, chat, away, xa, dnd, invisible '), True),
+                                               (_('status'), _('one of: 
offline, online, chat, away, xa, dnd, invisible. If not set, use accoun\'t 
previous status'), False),
                                                (_('message'), _('status 
message'), False),
                                                (_('account'), _('change status 
of account "account". '
                'If not specified, try to change status of all accounts that 
have '
diff -r 50c1a5f0a005 -r 1eb1facb0e21 src/remote_control.py
--- a/src/remote_control.py     Thu Jan 14 15:50:21 2010 +0100
+++ b/src/remote_control.py     Thu Jan 14 21:16:13 2010 +0100
@@ -416,9 +416,13 @@
                specified status is changed for all accounts
                """
                if status not in ('offline', 'online', 'chat',
-                       'away', 'xa', 'dnd', 'invisible'):
-                       return DBUS_BOOLEAN(False)
+               'away', 'xa', 'dnd', 'invisible'):
+                       status = ''
                if account:
+                       if not status:
+                               if account not in gajim.connections:
+                                       return DBUS_BOOLEAN(False)
+                               status = 
gajim.SHOW_LIST[gajim.connections[account].connected]
                        gobject.idle_add(gajim.interface.roster.send_status, 
account,
                                status, message)
                else:
@@ -427,8 +431,14 @@
                                if not gajim.config.get_per('accounts', acc,
                                'sync_with_global_status'):
                                        continue
+                               if status:
+                                       status_ = status
+                               else:
+                                       if acc not in gajim.connections:
+                                               continue
+                                       status_ = 
gajim.SHOW_LIST[gajim.connections[acc].connected]
                                
gobject.idle_add(gajim.interface.roster.send_status, acc,
-                                       status, message)
+                                       status_, message)
                return DBUS_BOOLEAN(False)
 
        @dbus.service.method(INTERFACE, in_signature='ss', out_signature='')
_______________________________________________
Commits mailing list
[email protected]
http://lists.gajim.org/cgi-bin/listinfo/commits

Reply via email to