Rename inbox to flag to sync it and bogofilter spam

This commit is contained in:
Felix Van der Jeugt 2020-11-14 14:36:43 +01:00
parent 0030cd4860
commit 3915f133fd
No known key found for this signature in database
GPG key ID: 58B209295023754D
6 changed files with 42 additions and 36 deletions

View file

@ -15,20 +15,20 @@ async def delay(ui, days):
if days != 0:
for message in messages:
if 'inbox' in message.get_tags():
if 'flagged' in message.get_tags():
message.add_tags(['delay', datetag])
await ui.apply_commandline('untag inbox,unread')
await ui.apply_commandline('untag flagged,unread')
else:
for message in messages:
if 'delay' in message.get_tags():
message.remove_tags([t for t in message.get_tags() if t.startswith('delay')])
message.add_tags(['inbox'])
message.add_tags(['flagged'])
await ui.apply_commandline('untag delay,delay/*')
async def spam(ui):
message = ui.current_buffer.get_selected_message()
message.add_tags(['spam'])
message.remove_tags(['unread', 'inbox'])
message.remove_tags(['unread', 'flagged'])
if 'ugent' in message.get_tags():
envelope = Envelope(
headers=dict(