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

Allow modules to store already existing 3PID associations #12195

Merged
merged 3 commits into from
Mar 28, 2022
Merged
Show file tree
Hide file tree
Changes from 2 commits
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
1 change: 1 addition & 0 deletions changelog.d/12195.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Allow modules to store already existing 3PID associations.
18 changes: 18 additions & 0 deletions synapse/module_api/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -1274,6 +1274,24 @@ async def check_username(self, username: str) -> None:
"""
await self._registration_handler.check_username(username)

async def store_remote_3pid_association(
babolivier marked this conversation as resolved.
Show resolved Hide resolved
self, user_id: str, medium: str, address: str, id_server: str
) -> None:
"""Stores an existing association between a user ID and a third-party identifier.

The association must already exist on the remote identity server.

Added in Synapse v1.55.0.

Args:
user_id: The user ID that's been associated with the 3PID.
medium: The medium of the 3PID (current supported values are "msisdn" and
"email").
address: The address of the 3PID.
id_server: The identity server the 3PID association has been registered on.
babolivier marked this conversation as resolved.
Show resolved Hide resolved
"""
await self._store.add_user_bound_threepid(user_id, medium, address, id_server)
anoadragon453 marked this conversation as resolved.
Show resolved Hide resolved


class PublicRoomListManager:
"""Contains methods for adding to, removing from and querying whether a room
Expand Down