new: the grid plugin now triggers an on_unread_inbox event that other plugins can intercept (see led plugin)
This commit is contained in:
parent
bd61196c3c
commit
9bc7fcccb3
@ -89,6 +89,7 @@ main:
|
||||
loaded: 'oo oo oo oo oo oo oo'
|
||||
updating: 'oo oo oo oo oo oo oo'
|
||||
# internet_available: 'oo oo oo oo oo oo oo'
|
||||
unread_inbox: 'oo oo oo oo oo oo oo'
|
||||
ready: 'oo oo oo oo oo oo oo'
|
||||
ai_ready: 'oo oo oo oo oo oo oo'
|
||||
ai_training_start: 'oo oo oo oo oo oo oo'
|
||||
|
@ -77,6 +77,7 @@ class Grid(plugins.Plugin):
|
||||
self.unread_messages = len([m for m in messages if m['seen_at'] is None])
|
||||
|
||||
if self.unread_messages:
|
||||
plugins.on('unread_inbox', self.unread_messages)
|
||||
logging.debug("[grid] unread:%d total:%d" % (self.unread_messages, self.total_messages))
|
||||
agent.view().on_unread_messages(self.unread_messages, self.total_messages)
|
||||
|
||||
|
@ -73,6 +73,10 @@ class Led(plugins.Plugin):
|
||||
def on_updating(self):
|
||||
self._on_event('updating')
|
||||
|
||||
# called when there's one or more unread pwnmail messages
|
||||
def on_unread_inbox(self, num_unread):
|
||||
self._on_event('unread_inbox')
|
||||
|
||||
# called when there's internet connectivity
|
||||
def on_internet_available(self, agent):
|
||||
self._on_event('internet_available')
|
||||
|
Loading…
x
Reference in New Issue
Block a user