mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2025-05-05 14:04:55 -04:00
Fix email notifications for invites without local state. (#8627)
This can happen if e.g. the room invited into is no longer on the server (or if all users left the room).
This commit is contained in:
parent
054a6b9538
commit
db9ef792f0
3 changed files with 58 additions and 13 deletions
|
@ -131,6 +131,35 @@ class EmailPusherTests(HomeserverTestCase):
|
|||
# We should get emailed about that message
|
||||
self._check_for_mail()
|
||||
|
||||
def test_invite_sends_email(self):
|
||||
# Create a room and invite the user to it
|
||||
room = self.helper.create_room_as(self.others[0].id, tok=self.others[0].token)
|
||||
self.helper.invite(
|
||||
room=room,
|
||||
src=self.others[0].id,
|
||||
tok=self.others[0].token,
|
||||
targ=self.user_id,
|
||||
)
|
||||
|
||||
# We should get emailed about the invite
|
||||
self._check_for_mail()
|
||||
|
||||
def test_invite_to_empty_room_sends_email(self):
|
||||
# Create a room and invite the user to it
|
||||
room = self.helper.create_room_as(self.others[0].id, tok=self.others[0].token)
|
||||
self.helper.invite(
|
||||
room=room,
|
||||
src=self.others[0].id,
|
||||
tok=self.others[0].token,
|
||||
targ=self.user_id,
|
||||
)
|
||||
|
||||
# Then have the original user leave
|
||||
self.helper.leave(room, self.others[0].id, tok=self.others[0].token)
|
||||
|
||||
# We should get emailed about the invite
|
||||
self._check_for_mail()
|
||||
|
||||
def test_multiple_members_email(self):
|
||||
# We want to test multiple notifications, so we pause processing of push
|
||||
# while we send messages.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue