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

Commit 7bc08f3

Browse files
authored
Remove remaining bits of groups code. (#12936)
* Update worker docs to remove group endpoints. * Removes an unused parameter to `ApplicationService`. * Break dependency between media repo and groups. * Avoid copying `m.room.related_groups` state events during room upgrades.
1 parent 88193f2 commit 7bc08f3

File tree

19 files changed

+1
-35
lines changed

19 files changed

+1
-35
lines changed

changelog.d/12936.removal

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Remove support for the non-standard groups/communities feature from Synapse.

docs/workers.md

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,6 @@ information.
191191
^/_matrix/federation/v1/event_auth/
192192
^/_matrix/federation/v1/exchange_third_party_invite/
193193
^/_matrix/federation/v1/user/devices/
194-
^/_matrix/federation/v1/get_groups_publicised$
195194
^/_matrix/key/v2/query
196195
^/_matrix/federation/v1/hierarchy/
197196

@@ -213,9 +212,6 @@ information.
213212
^/_matrix/client/(r0|v3|unstable)/devices$
214213
^/_matrix/client/versions$
215214
^/_matrix/client/(api/v1|r0|v3|unstable)/voip/turnServer$
216-
^/_matrix/client/(r0|v3|unstable)/joined_groups$
217-
^/_matrix/client/(r0|v3|unstable)/publicised_groups$
218-
^/_matrix/client/(r0|v3|unstable)/publicised_groups/
219215
^/_matrix/client/(api/v1|r0|v3|unstable)/rooms/.*/event/
220216
^/_matrix/client/(api/v1|r0|v3|unstable)/joined_rooms$
221217
^/_matrix/client/(api/v1|r0|v3|unstable)/search$
@@ -255,9 +251,7 @@ information.
255251

256252
Additionally, the following REST endpoints can be handled for GET requests:
257253

258-
^/_matrix/federation/v1/groups/
259254
^/_matrix/client/(api/v1|r0|v3|unstable)/pushrules/
260-
^/_matrix/client/(r0|v3|unstable)/groups/
261255

262256
Pagination requests can also be handled, but all requests for a given
263257
room must be routed to the same instance. Additionally, care must be taken to

synapse/api/constants.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,6 @@ class EventTypes:
9595
Aliases: Final = "m.room.aliases"
9696
Redaction: Final = "m.room.redaction"
9797
ThirdPartyInvite: Final = "m.room.third_party_invite"
98-
RelatedGroups: Final = "m.room.related_groups"
9998

10099
RoomHistoryVisibility: Final = "m.room.history_visibility"
101100
CanonicalAlias: Final = "m.room.canonical_alias"

synapse/appservice/__init__.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,6 @@ class ApplicationService:
7070
def __init__(
7171
self,
7272
token: str,
73-
hostname: str,
7473
id: str,
7574
sender: str,
7675
url: Optional[str] = None,
@@ -88,7 +87,6 @@ def __init__(
8887
) # url must not end with a slash
8988
self.hs_token = hs_token
9089
self.sender = sender
91-
self.server_name = hostname
9290
self.namespaces = self._check_namespaces(namespaces)
9391
self.id = id
9492
self.ip_range_whitelist = ip_range_whitelist

synapse/config/appservice.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,6 @@ def _load_appservice(
179179

180180
return ApplicationService(
181181
token=as_info["as_token"],
182-
hostname=hostname,
183182
url=as_info["url"],
184183
namespaces=as_info["namespaces"],
185184
hs_token=as_info["hs_token"],

synapse/handlers/room.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -468,7 +468,6 @@ async def clone_existing_room(
468468
(EventTypes.RoomAvatar, ""),
469469
(EventTypes.RoomEncryption, ""),
470470
(EventTypes.ServerACL, ""),
471-
(EventTypes.RelatedGroups, ""),
472471
(EventTypes.PowerLevels, ""),
473472
]
474473

synapse/storage/databases/main/media_repository.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -276,10 +276,6 @@ async def get_local_media_before(
276276
(SELECT 1
277277
FROM profiles
278278
WHERE profiles.avatar_url = '{media_prefix}' || lmr.media_id)
279-
AND NOT EXISTS
280-
(SELECT 1
281-
FROM groups
282-
WHERE groups.avatar_url = '{media_prefix}' || lmr.media_id)
283279
AND NOT EXISTS
284280
(SELECT 1
285281
FROM room_memberships

tests/api/test_auth.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -404,7 +404,6 @@ def test_blocking_mau__appservice_requester_allowed_when_not_tracking_ips(self):
404404

405405
appservice = ApplicationService(
406406
"abcd",
407-
self.hs.config.server.server_name,
408407
id="1234",
409408
namespaces={
410409
"users": [{"regex": "@_appservice.*:sender", "exclusive": True}]
@@ -433,7 +432,6 @@ def test_blocking_mau__appservice_requester_disallowed_when_tracking_ips(self):
433432

434433
appservice = ApplicationService(
435434
"abcd",
436-
self.hs.config.server.server_name,
437435
id="1234",
438436
namespaces={
439437
"users": [{"regex": "@_appservice.*:sender", "exclusive": True}]

tests/api/test_ratelimiting.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@ def test_allowed_via_can_do_action(self):
3131
def test_allowed_appservice_ratelimited_via_can_requester_do_action(self):
3232
appservice = ApplicationService(
3333
None,
34-
"example.com",
3534
id="foo",
3635
rate_limited=True,
3736
sender="@as:example.com",
@@ -62,7 +61,6 @@ def test_allowed_appservice_ratelimited_via_can_requester_do_action(self):
6261
def test_allowed_appservice_via_can_requester_do_action(self):
6362
appservice = ApplicationService(
6463
None,
65-
"example.com",
6664
id="foo",
6765
rate_limited=False,
6866
sender="@as:example.com",

tests/appservice/test_api.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@ def prepare(self, reactor: MemoryReactor, clock: Clock, hs: HomeServer):
3737
url=URL,
3838
token="unused",
3939
hs_token=TOKEN,
40-
hostname="myserver",
4140
)
4241

4342
def test_query_3pe_authenticates_token(self):

0 commit comments

Comments
 (0)