+ def __get_contact_alias(self):
+ '''Returns the correct name to display for a buddy, taking the contact
+ alias into account. In order of precedence: the buddy's alias;
+ the buddy's contact alias; the buddy's server alias; the buddy's
+ user name.
+
+ @return The appropriate name or alias, or None.
+ '''
+
+ cdef char *c_contact_alias = NULL
+ c_contact_alias = <char *> blist.purple_buddy_get_contact_alias( \
+ self._get_structure())
+ if c_contact_alias:
+ return c_contact_alias
+ else:
+ return None
+ contact_alias = property(__get_contact_alias)
+
+ def __get_local_alias(self):
+ '''Returns the correct alias for this user, ignoring server aliases.
+ Used when a user-recognizable name is required. In order: buddy's
+ alias; buddy's contact alias; buddy's user name.
+
+ @return The appropriate name or alias, or None.
+ '''
+
+ cdef char *c_local_alias = NULL
+ c_local_alias = <char *> blist.purple_buddy_get_local_alias( \
+ self._get_structure())
+ if c_local_alias:
+ return c_local_alias
+ else:
+ return None
+ local_alias = property(__get_local_alias)
+
+ def __get_available(self):
+ '''Returns whether or not buddy's presence is available.
+ Available presences are online and possibly invisible, but not away or idle.
+
+ @return True if the buddy's presence is available, or False otherwise.
+ '''
+
+ if self.__exists:
+ return status.purple_presence_is_available( \
+ blist.purple_buddy_get_presence(self._get_structure()))
+ else:
+ return False
+ available = property(__get_available)
+
+ def __get_online(self):
+ '''Returns whether or not the buddy's presence is online.
+
+ @return True if the buddy's presence is online, of False otherwise.
+ '''
+
+ if self.__exists:
+ return status.purple_presence_is_online( \
+ blist.purple_buddy_get_presence(self._get_structure()))
+ else:
+ return False