Commit 2890da56 authored by Yann Leboulanger's avatar Yann Leboulanger

[dimorph] get_unread_msgs_number function in gajim-remote

parent f4e95cdc
......@@ -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
......
......@@ -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)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment