[dimorph] get_unread_msgs_number function in gajim-remote

This commit is contained in:
Yann Leboulanger 2006-02-20 17:25:26 +00:00
parent f4e95cdc8d
commit 2890da56dd
2 changed files with 10 additions and 1 deletions

View File

@ -210,6 +210,11 @@ class GajimRemote:
(_('account'), _(''), False)
]
],
'get_unread_msgs_number': [
_('Returns number of unreaded messages'),
[ ]
],
}
if self.argv_len < 2 or \
sys.argv[1] not in self.commands.keys(): # no args or bad args

View File

@ -547,7 +547,10 @@ class SignalObject(DbusPrototype):
contact_dict['resources'].append(tuple(resource_props))
contact_dict['resources'] = DBUS_VARIANT(contact_dict['resources'])
return contact_dict
def get_unread_msgs_number(self, *args):
return str(gajim.interface.roster.nb_unread)
if dbus_support.version[1] >= 30 and dbus_support.version[1] <= 40:
method = dbus.method
signal = dbus.signal
@ -576,3 +579,4 @@ class SignalObject(DbusPrototype):
get_status = method(INTERFACE)(get_status)
get_status_message = method(INTERFACE)(get_status_message)
account_info = method(INTERFACE)(account_info)
get_unread_msgs_number = method(INTERFACE)(get_unread_msgs_number)