From 4ea7e80be129e766b58e1835c3be7f28cbacba67 Mon Sep 17 00:00:00 2001 From: Steve Howell Date: Sat, 21 Jan 2017 06:30:55 -0800 Subject: [PATCH] Change our_person() in apply_events() to use user_id. This is a pretty minor change, but it makes it clear that we have user_id in all the relevant states/events, so we might as well use that for the check, since email is mutable and slightly more difficult to reason about. --- zerver/lib/actions.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/zerver/lib/actions.py b/zerver/lib/actions.py index 32901fdb6d..6f6c6c61d7 100644 --- a/zerver/lib/actions.py +++ b/zerver/lib/actions.py @@ -3178,7 +3178,7 @@ def apply_events(state, events, user_profile): def our_person(p): # type: (Dict[str, Any]) -> bool - return p['email'] == person['email'] + return p['user_id'] == person['user_id'] if event['op'] == "add": state['realm_users'].append(person)