From: Ragner Magalhaes Date: Tue, 2 Dec 2008 20:20:50 +0000 (+0000) Subject: Fix get_buddies_online X-Git-Url: http://git.maemo.org/git/?p=python-purple;a=commitdiff_plain;h=96cd4db66ee4749fb6d00e74e0bc9e3101e43079;hp=e7e4e8ff4937aed9c1b732719bc310c3e8a88f5e Fix get_buddies_online Small fix related to get_buddies_online function implemented in account.pyx Signed-off-by: Anderson Briglia git-svn-id: https://garage.maemo.org/svn/carman/branches/carman-0.7-beta2/python-purple@1296 596f6dd7-e928-0410-a184-9e12fd12cf7e --- diff --git a/account.pyx b/account.pyx index 0e98548..a3f996b 100644 --- a/account.pyx +++ b/account.pyx @@ -50,14 +50,14 @@ cdef class Account: self.__sstatus = savedstatuses.c_purple_savedstatus_new(NULL, status.PURPLE_STATUS_AVAILABLE) savedstatuses.c_purple_savedstatus_activate(self.__sstatus) - def get_buddies_online(self, acc): + def get_buddies_online(self): cdef glib.GSList *iter cdef blist.PurpleBuddy *buddy buddies = [] iter = blist.c_purple_find_buddies(self.__account, NULL) while iter: buddy = iter.data - if buddy and \ + if buddy and \ account.c_purple_account_is_connected(blist.c_purple_buddy_get_account(buddy)) and \ status.c_purple_presence_is_online(blist.c_purple_buddy_get_presence(buddy)): buddies += [buddy.name] diff --git a/nullclient.py b/nullclient.py index 2b7dd70..d0fcb9b 100644 --- a/nullclient.py +++ b/nullclient.py @@ -24,8 +24,8 @@ class NullClient: self.account.set_password(password) self.account.set_enabled("carman-purple-python", True) - def get_buddies(self, account): - buddies = account.get_buddies_online(account) + def get_buddies(self): + buddies = self.account.get_buddies_online() print buddies def getuser(): @@ -46,5 +46,5 @@ if __name__ == '__main__': client.new_account(username, client.protocol, password) client.p.connect() - ecore.timer_add(30, client.get_buddies, client.account) + ecore.timer_add(20, client.get_buddies) ecore.main_loop_begin()