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

Commit

Permalink
Return a BAD_ALIAS error code if the alias does not point to the room.
Browse files Browse the repository at this point in the history
  • Loading branch information
clokep committed Mar 2, 2020
1 parent c262f2f commit d183d8a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions synapse/api/errors.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ class Codes(object):
EXPIRED_ACCOUNT = "ORG_MATRIX_EXPIRED_ACCOUNT"
INVALID_SIGNATURE = "M_INVALID_SIGNATURE"
USER_DEACTIVATED = "M_USER_DEACTIVATED"
BAD_ALIAS = "M_BAD_ALIAS"


class CodeMessageException(RuntimeError):
Expand Down
4 changes: 2 additions & 2 deletions synapse/handlers/message.py
Original file line number Diff line number Diff line change
Expand Up @@ -912,7 +912,7 @@ def persist_and_notify_client_event(
raise SynapseError(
400,
"Room alias %s does not point to the room" % (room_alias_str,),
Codes.NOT_FOUND,
Codes.BAD_ALIAS,
)

# Check that alt_aliases is the proper form.
Expand All @@ -939,7 +939,7 @@ def persist_and_notify_client_event(
400,
"Room alias %s does not point to the room"
% (room_alias_str,),
Codes.NOT_FOUND,
Codes.BAD_ALIAS,
)

federation_handler = self.hs.get_handlers().federation_handler
Expand Down

0 comments on commit d183d8a

Please sign in to comment.