display messages flags and save when a message is read
This commit is contained in:
parent
8ea375669a
commit
41e0af0b48
1 changed files with 22 additions and 4 deletions
|
|
@ -85,13 +85,27 @@ class MessagesListFormatter(IFormatter):
|
||||||
if not message:
|
if not message:
|
||||||
return u''
|
return u''
|
||||||
self.count += 1
|
self.count += 1
|
||||||
|
|
||||||
|
flags = '['
|
||||||
|
if message.flags & message.IS_UNREAD:
|
||||||
|
flags += 'N'
|
||||||
|
else:
|
||||||
|
flags += '-'
|
||||||
|
if message.flags & message.IS_NOT_ACCUSED:
|
||||||
|
flags += 'U'
|
||||||
|
elif message.flags & message.IS_ACCUSED:
|
||||||
|
flags += 'R'
|
||||||
|
else:
|
||||||
|
flags += '-'
|
||||||
|
flags += ']'
|
||||||
|
|
||||||
if self.interactive:
|
if self.interactive:
|
||||||
result = u'%s%s* (%d)%s <%s> %s (%s)\n' % (depth * ' ', ReplApplication.BOLD, self.count,
|
result = u'%s%s* (%d)%s %s <%s> %s (%s)\n' % (depth * ' ', ReplApplication.BOLD, self.count,
|
||||||
ReplApplication.NC, message.sender, message.title,
|
ReplApplication.NC, flags, message.sender, message.title,
|
||||||
backend)
|
backend)
|
||||||
else:
|
else:
|
||||||
result = u'%s%s* (%s@%s)%s <%s> %s\n' % (depth * ' ', ReplApplication.BOLD, message.id, backend,
|
result = u'%s%s* (%s@%s)%s %s <%s> %s\n' % (depth * ' ', ReplApplication.BOLD, message.id, backend,
|
||||||
ReplApplication.NC, message.sender, message.title)
|
flags, ReplApplication.NC, message.sender, message.title)
|
||||||
if message.children:
|
if message.children:
|
||||||
if depth >= 0:
|
if depth >= 0:
|
||||||
depth += 1
|
depth += 1
|
||||||
|
|
@ -115,6 +129,9 @@ class Boobmsg(ReplApplication):
|
||||||
def add_application_options(self, group):
|
def add_application_options(self, group):
|
||||||
group.add_option('-e', '--skip-empty', action='store_true', help='Don\'t send messages with an empty body.')
|
group.add_option('-e', '--skip-empty', action='store_true', help='Don\'t send messages with an empty body.')
|
||||||
|
|
||||||
|
def load_default_backends(self):
|
||||||
|
self.load_backends(ICapMessages, storage=self.create_storage())
|
||||||
|
|
||||||
def do_status(self, line):
|
def do_status(self, line):
|
||||||
"""
|
"""
|
||||||
status
|
status
|
||||||
|
|
@ -246,6 +263,7 @@ class Boobmsg(ReplApplication):
|
||||||
id, backend_name = self.parse_id(arg)
|
id, backend_name = self.parse_id(arg)
|
||||||
else:
|
else:
|
||||||
self.format(message)
|
self.format(message)
|
||||||
|
self.weboob.do('set_message_read', message, backends=message.backend)
|
||||||
return
|
return
|
||||||
|
|
||||||
if not self.interactive:
|
if not self.interactive:
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue