mirror of
https://github.com/zulip/zulip.git
synced 2025-11-04 22:13:26 +00:00
We will in later commits, extend this class to contain methods to determine if a message is notifiable or not, but for now we only turn it into a dict and pass it on.
21 lines
514 B
Python
21 lines
514 B
Python
from dataclasses import dataclass
|
|
from typing import List
|
|
|
|
|
|
@dataclass
|
|
class UserMessageNotificationsData:
|
|
id: int
|
|
flags: List[str]
|
|
mentioned: bool
|
|
online_push_enabled: bool
|
|
stream_push_notify: bool
|
|
stream_email_notify: bool
|
|
wildcard_mention_notify: bool
|
|
sender_is_muted: bool
|
|
|
|
def __post_init__(self) -> None:
|
|
if self.mentioned:
|
|
assert "mentioned" in self.flags
|
|
if self.wildcard_mention_notify:
|
|
assert "wildcard_mentioned" in self.flags
|