quick frontends, primitivus: messageState signal handling

This commit is contained in:
Goffi 2016-08-02 23:11:44 +02:00
commit 2d468f9e94

View file

@ -81,6 +81,7 @@ class MessageWidget(urwid.WidgetWrap):
def redraw(self):
self._w.set_text(self.markup)
self.mess_data.parent.host.redraw() # FIXME: should not be necessary
def selectable(self):
return True
@ -108,6 +109,14 @@ class MessageWidget(urwid.WidgetWrap):
d = self.mess_data
mention = d.mention
# message status
if d.status is None:
markup.append(u' ')
elif d.status == "delivered":
markup.append(('msg_status_received', u'✔'))
else:
log.warning(u"Unknown status: {}".format(d.status))
# timestamp
if self.parent.show_timestamp:
# if the message was sent before today, we print the full date
@ -134,6 +143,10 @@ class MessageWidget(urwid.WidgetWrap):
return markup
# events
def updated(self, attributes):
self.redraw()
@total_ordering
class OccupantWidget(urwid.WidgetWrap):