quick frontends, primitivus: messageState signal handling
This commit is contained in:
parent
3f5a26f273
commit
2d468f9e94
1 changed files with 38 additions and 0 deletions
|
|
@ -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):
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue