block membership events from spammy freenode bridge

pull/8675/head
Richard van der Hoff 2020-10-12 19:09:30 +01:00
parent 4b43332131
commit cd2f831b9d
1 changed files with 4 additions and 0 deletions

View File

@ -291,6 +291,8 @@ class JoinRoomAliasServlet(TransactionRestServlet):
async def on_POST(self, request, room_identifier, txn_id=None): async def on_POST(self, request, room_identifier, txn_id=None):
requester = await self.auth.get_user_by_req(request, allow_guest=True) requester = await self.auth.get_user_by_req(request, allow_guest=True)
if requester.app_service and requester.app_service.id == "irc-freenode":
raise SynapseError(400, "too much spam")
try: try:
content = parse_json_object_from_request(request) content = parse_json_object_from_request(request)
@ -720,6 +722,8 @@ class RoomMembershipRestServlet(TransactionRestServlet):
async def on_POST(self, request, room_id, membership_action, txn_id=None): async def on_POST(self, request, room_id, membership_action, txn_id=None):
requester = await self.auth.get_user_by_req(request, allow_guest=True) requester = await self.auth.get_user_by_req(request, allow_guest=True)
if requester.app_service and requester.app_service.id == "irc-freenode":
raise SynapseError(400, "too much spam")
if requester.is_guest and membership_action not in { if requester.is_guest and membership_action not in {
Membership.JOIN, Membership.JOIN,