From a2dfab12c5f0d27e38595763bb44a45b91374082 Mon Sep 17 00:00:00 2001 From: David Baker Date: Thu, 23 Mar 2017 18:46:17 +0000 Subject: [PATCH 1/2] Fix token request for addition of phone numbers --- synapse/rest/client/v2_alpha/account.py | 2 +- synapse/visibility.py | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/synapse/rest/client/v2_alpha/account.py b/synapse/rest/client/v2_alpha/account.py index aac76edf1c..4990b22b9f 100644 --- a/synapse/rest/client/v2_alpha/account.py +++ b/synapse/rest/client/v2_alpha/account.py @@ -268,7 +268,7 @@ class MsisdnThreepidRequestTokenRestServlet(RestServlet): if existingUid is not None: raise SynapseError(400, "MSISDN is already in use", Codes.THREEPID_IN_USE) - ret = yield self.identity_handler.requestEmailToken(**body) + ret = yield self.identity_handler.requestMsisdnToken(**body) defer.returnValue((200, ret)) diff --git a/synapse/visibility.py b/synapse/visibility.py index 199b16d827..31659156ae 100644 --- a/synapse/visibility.py +++ b/synapse/visibility.py @@ -134,6 +134,13 @@ def filter_events_for_clients(store, user_tuples, events, event_id_to_state): if prev_membership not in MEMBERSHIP_PRIORITY: prev_membership = "leave" + # Always allow the user to see their own leave events, otherwise + # they won't see the room disappear if they reject the invite + if membership == "leave" and ( + prev_membership == "join" or prev_membership == "invite" + ): + return True + new_priority = MEMBERSHIP_PRIORITY.index(membership) old_priority = MEMBERSHIP_PRIORITY.index(prev_membership) if old_priority < new_priority: From 86e865d7d2f22bce2c5aa72f20938129d8277a4e Mon Sep 17 00:00:00 2001 From: David Baker Date: Thu, 23 Mar 2017 18:48:30 +0000 Subject: [PATCH 2/2] Oops, remove unintentional change --- synapse/visibility.py | 7 ------- 1 file changed, 7 deletions(-) diff --git a/synapse/visibility.py b/synapse/visibility.py index 31659156ae..199b16d827 100644 --- a/synapse/visibility.py +++ b/synapse/visibility.py @@ -134,13 +134,6 @@ def filter_events_for_clients(store, user_tuples, events, event_id_to_state): if prev_membership not in MEMBERSHIP_PRIORITY: prev_membership = "leave" - # Always allow the user to see their own leave events, otherwise - # they won't see the room disappear if they reject the invite - if membership == "leave" and ( - prev_membership == "join" or prev_membership == "invite" - ): - return True - new_priority = MEMBERSHIP_PRIORITY.index(membership) old_priority = MEMBERSHIP_PRIORITY.index(prev_membership) if old_priority < new_priority: