From 2407f3f9c41dae2ce381c848f6dfd7f1cc90973a Mon Sep 17 00:00:00 2001 From: Greg Price Date: Mon, 15 Jul 2019 15:47:29 -0700 Subject: [PATCH] event: Use proper ownEmail in eventToAction. Part of #3196 -- this is another bit where we were using the user's (real) auth email where their (possibly different and fake) identifier-email is what we need. --- src/events/eventToAction.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/events/eventToAction.js b/src/events/eventToAction.js index 2bad254c1c7..01e14fee905 100644 --- a/src/events/eventToAction.js +++ b/src/events/eventToAction.js @@ -31,6 +31,7 @@ import { EVENT_SUBSCRIPTION, EVENT, } from '../actionConstants'; +import { getOwnEmail } from '../account/accountsSelectors'; const opToActionUser = { add: EVENT_USER_ADD, @@ -84,7 +85,7 @@ export default (state: GlobalState, event: $FlowFixMe): EventAction => { ...event, type: EVENT_NEW_MESSAGE, caughtUp: state.caughtUp, - ownEmail: state.accounts[0].email, + ownEmail: getOwnEmail(state), }; case 'delete_message': @@ -142,7 +143,7 @@ export default (state: GlobalState, event: $FlowFixMe): EventAction => { case 'typing': return { ...event, - ownEmail: state.accounts[0].email, + ownEmail: getOwnEmail(state), type: opToActionTyping[event.op], time: new Date().getTime(), };