Fix get_buddies_online
authorRagner Magalhaes <ragner.magalhaes@openbossa.org>
Tue, 2 Dec 2008 20:20:50 +0000 (20:20 +0000)
committerAnderson Briglia <anderson.briglia@openbossa.org>
Sat, 28 Feb 2009 21:11:10 +0000 (17:11 -0400)
Small fix related to get_buddies_online function implemented in account.pyx

Signed-off-by: Anderson Briglia <anderson.briglia@indt.org.br>

git-svn-id: https://garage.maemo.org/svn/carman/branches/carman-0.7-beta2/python-purple@1296 596f6dd7-e928-0410-a184-9e12fd12cf7e

account.pyx
nullclient.py

index 0e98548..a3f996b 100644 (file)
@@ -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 = <blist.PurpleBuddy *> iter.data
-            if <object> buddy and \
+            if <blist.PurpleBuddy *>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]
index 2b7dd70..d0fcb9b 100644 (file)
@@ -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()