2020-08-31 15:32:30 +02:00
|
|
|
from platypush.message.event import Event
|
|
|
|
|
|
|
|
|
|
|
|
class MailEvent(Event):
|
2024-02-03 22:09:40 +01:00
|
|
|
"""
|
|
|
|
Base class for mail events.
|
|
|
|
"""
|
|
|
|
|
|
|
|
def __init__(self, *args, account: str, folder: str, message, **kwargs):
|
|
|
|
super().__init__(
|
|
|
|
*args, account=account, folder=folder, message=message, **kwargs
|
|
|
|
)
|
2020-08-31 15:32:30 +02:00
|
|
|
|
|
|
|
|
2024-02-03 22:09:40 +01:00
|
|
|
class UnseenMailEvent(MailEvent):
|
2020-08-31 15:32:30 +02:00
|
|
|
"""
|
2024-02-03 22:09:40 +01:00
|
|
|
Triggered when a new email is received or marked as unseen.
|
2020-08-31 15:32:30 +02:00
|
|
|
"""
|
|
|
|
|
|
|
|
|
2024-02-03 22:09:40 +01:00
|
|
|
class SeenMailEvent(MailEvent):
|
2020-08-31 15:32:30 +02:00
|
|
|
"""
|
|
|
|
Triggered when a previously unseen email is seen.
|
|
|
|
"""
|
|
|
|
|
|
|
|
|
2024-02-03 22:09:40 +01:00
|
|
|
class FlaggedMailEvent(MailEvent):
|
2020-09-02 00:07:08 +02:00
|
|
|
"""
|
|
|
|
Triggered when a message is marked as flagged/starred.
|
|
|
|
"""
|
|
|
|
|
|
|
|
|
2024-02-03 22:09:40 +01:00
|
|
|
class UnflaggedMailEvent(MailEvent):
|
2020-09-02 00:07:08 +02:00
|
|
|
"""
|
|
|
|
Triggered when a message previously marked as flagged/starred is unflagged.
|
|
|
|
"""
|
|
|
|
|
|
|
|
|
2020-08-31 15:32:30 +02:00
|
|
|
# vim:sw=4:ts=4:et:
|