X-Git-Url: http://git.maemo.org/git/?p=python-purple;a=blobdiff_plain;f=account.pxd;h=b5c765ff964e2f3c1a7d80c0f28bf0c9cfb8828f;hp=cafdf0704136c64ab1924d1cc10161f0ba05702e;hb=3317112f6f04d1fdc7b338b947f18e811c9b9e7e;hpb=26e6c93524a3aebf8bff921ca5a6637a6f50cf6c diff --git a/account.pxd b/account.pxd index cafdf07..b5c765f 100644 --- a/account.pxd +++ b/account.pxd @@ -66,3 +66,16 @@ cdef class Account: self.__sstatus = c_purple_savedstatus_new(NULL, StatusPrimitive().STATUS_AVAILABLE) c_purple_savedstatus_activate(self.__sstatus) + def get_buddies_online(self, account): + cdef GSList *iter + cdef PurpleBuddy *buddy + buddies = [] + iter = c_purple_find_buddies(self.__account, NULL) + while iter: + buddy = iter.data + if buddy and \ + c_purple_account_is_connected(c_purple_buddy_get_account(buddy)) and \ + c_purple_presence_is_online(c_purple_buddy_get_presence(buddy)): + buddies += [buddy.name] + iter = iter.next + return buddies