mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2025-05-03 00:34:47 -04:00
Test that we require validated email for email pushers (#9496)
This commit is contained in:
parent
1e62d9ee8c
commit
2566dc57ce
3 changed files with 39 additions and 2 deletions
|
@ -19,6 +19,7 @@ from typing import TYPE_CHECKING, Dict, Iterable, Optional
|
|||
|
||||
from prometheus_client import Gauge
|
||||
|
||||
from synapse.api.errors import Codes, SynapseError
|
||||
from synapse.metrics.background_process_metrics import (
|
||||
run_as_background_process,
|
||||
wrap_as_background_process,
|
||||
|
@ -113,6 +114,11 @@ class PusherPool:
|
|||
The newly created pusher.
|
||||
"""
|
||||
|
||||
if kind == "email":
|
||||
email_owner = await self.store.get_user_id_by_threepid("email", pushkey)
|
||||
if email_owner != user_id:
|
||||
raise SynapseError(400, "Email not found", Codes.THREEPID_NOT_FOUND)
|
||||
|
||||
time_now_msec = self.clock.time_msec()
|
||||
|
||||
# create the pusher setting last_stream_ordering to the current maximum
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue