def __init__(self, instance): super(MessageNotifyObject, self).__init__() friend = getFriend(instance) self._instance = instance self.title = getDisplayName(instance) self.image = avatarManager.get_avatar(friend.jid) self.total = 1 self.type_ = NOTIFY_TYPE_MESSAGE self.jid = friend.jid
def __init__(self, instance, parent=None): super(FriendWrapper, self).__init__(parent) self.jid = instance.jid self.nickname = instance.nickname self.remark = instance.remark try: self.groupName = instance.group.name except: self.groupName = "" self.avatar = avatarManager.get_avatar(self.jid) self.displayName = controlUtils.getDisplayName(instance) cacheSignals.avatar_saved.connect(self._onAvatarSaved) dbSignals.post_save.connect(self._onFriendPostSave, sender=Friend) xmppSignals.roster_changed_status.connect(self._onRosterChangedStatus)
def updateAvatar(self): self.avatar = avatarManager.get_avatar(self.jid)