Only allow tagging currently configured announcement rooms

This commit is contained in:
Paul Chobert committed 2026-10-30 11:27:41 +01:00
1 parent 5ea93a5955
commit bbef8a1b10
1 file changed
+1 -1
+1 -1
View File
@@ -103,7 +103,7 @@ class TagServlet(RestServlet):
# Check if the user has any membership in the room and raise error if not.
# Although it's not harmful for users to tag random rooms, it's just superfluous
# data we don't need to track or allow.
if await self.store.get_server_announcement_id(room_id) is None:
if room_id not in await self.store.get_server_announcement_room_ids():
await self.room_member_handler.check_for_any_membership_in_room(
user_id=user_id, room_id=room_id
)