# HG changeset patch # User Goffi # Date 1472426507 -7200 # Node ID a52a6ed7d48fb727357add2362d164805be2f88c # Parent 7bfa97e533ac25d0189b0be8abf6b80b0377f1b0 quick frontend (chat): added helping properties avatar and contact_list diff -r 7bfa97e533ac -r a52a6ed7d48f frontends/src/quick_frontend/quick_chat.py --- a/frontends/src/quick_frontend/quick_chat.py Mon Aug 29 01:21:45 2016 +0200 +++ b/frontends/src/quick_frontend/quick_chat.py Mon Aug 29 01:21:47 2016 +0200 @@ -115,6 +115,11 @@ time_format = u"%c" if timestamp < self.parent.day_change else u"%H:%M" return time.strftime(time_format, timestamp).decode(getlocale()[1]) + @property + def avatar(self): + contact_list = self.host.contact_lists[self.profile] + return contact_list.getCache(self.from_jid, "avatar") or self.host.getDefaultAvatar(self.from_jid) + def getNick(self, entity): """Return nick of an entity when possible""" contact_list = self.host.contact_lists[self.profile] @@ -241,6 +246,10 @@ if self.subject is not None: self.setSubject(self.subject) + @property + def contact_list(self): + return self.host.contact_lists[self.profile] + ## Widget management ## def __str__(self):