mirror of
https://github.com/zulip/zulip.git
synced 2025-11-14 10:57:58 +00:00
Fix auth checks for IRC mirroring.
There were a couple of bugs in the security checks that resulted in IRC mirroring of stream messages not working. (imported from commit 31ac732461a733c1c993f77356053d4f88c67177)
This commit is contained in:
@@ -1262,7 +1262,7 @@ def same_realm_irc_user(user_profile, email):
|
|||||||
|
|
||||||
domain = email_to_domain(email)
|
domain = email_to_domain(email)
|
||||||
|
|
||||||
return user_profile.realm.domain == domain.replace("@irc.", "@")
|
return user_profile.realm.domain == domain.replace("irc.", "")
|
||||||
|
|
||||||
def create_mirrored_message_users(request, user_profile, recipients):
|
def create_mirrored_message_users(request, user_profile, recipients):
|
||||||
if "sender" not in request.POST:
|
if "sender" not in request.POST:
|
||||||
@@ -1390,7 +1390,7 @@ def send_message_backend(request, user_profile,
|
|||||||
if client.name == "zephyr_mirror" and user_profile.realm.domain != "mit.edu":
|
if client.name == "zephyr_mirror" and user_profile.realm.domain != "mit.edu":
|
||||||
return json_error("Invalid mirrored realm")
|
return json_error("Invalid mirrored realm")
|
||||||
if (client.name == "irc_mirror" and message_type_name != "private" and
|
if (client.name == "irc_mirror" and message_type_name != "private" and
|
||||||
not message_to.startswith("#")):
|
not message_to[0].startswith("#")):
|
||||||
return json_error("IRC stream names must start with #")
|
return json_error("IRC stream names must start with #")
|
||||||
sender = mirror_sender
|
sender = mirror_sender
|
||||||
else:
|
else:
|
||||||
|
|||||||
Reference in New Issue
Block a user