Skip to content
This repository has been archived by the owner on Apr 26, 2024. It is now read-only.

Improved push typing #11409

Merged
merged 11 commits into from
Nov 30, 2021
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
lint
Bubu committed Nov 23, 2021
commit 2904f49c7406ee8af130a024e9bebb3fbf32205c
2 changes: 1 addition & 1 deletion synapse/push/httppusher.py
Original file line number Diff line number Diff line change
@@ -26,8 +26,8 @@
from synapse.logging import opentracing
from synapse.metrics.background_process_metrics import run_as_background_process
from synapse.push import Pusher, PusherConfig, PusherConfigException

from synapse.storage.databases.main.event_push_actions import HttpPushAction

from . import push_rule_evaluator, push_tools

if TYPE_CHECKING:
5 changes: 5 additions & 0 deletions synapse/push/push_types.py
Original file line number Diff line number Diff line change
@@ -32,6 +32,7 @@ class EmailReason(TypedDict, total=False):
throttle_ms: the minimum amount of time in milliseconds between two
notifications can be sent for this room
"""

room_id: str
now: int
room_name: Optional[str]
@@ -59,6 +60,7 @@ class MessageVars(TypedDict, total=False):
body_text_plain: plaintext representation of the message
image_url: mxc url of an image, when "msgtype" is "m.image"
"""

event_type: str
is_historical: bool
id: str
@@ -81,6 +83,7 @@ class NotifVars(TypedDict):
messages: a list of messages containing one message before the event, the
message in the event, and one message after the event.
"""

link: str
ts: Optional[int]
messages: List[MessageVars]
@@ -98,6 +101,7 @@ class RoomVars(TypedDict):
link: a `matrix.to` link to the room
avator_url: url to the room's avator
"""

title: Optional[str]
hash: int
invite: bool
@@ -121,6 +125,7 @@ class TemplateVars(TypedDict, total=False):
rooms: a list of rooms containing events to include in the email
reason: information on the event that triggered the email to be sent
"""

app_name: str
server_name: str
link: str