Skip to content

Commit

Permalink
event: Use proper ownEmail in eventToAction.
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
gnprice committed Jul 16, 2019
1 parent eb95b18 commit 2407f3f
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/events/eventToAction.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ import {
EVENT_SUBSCRIPTION,
EVENT,
} from '../actionConstants';
import { getOwnEmail } from '../account/accountsSelectors';

const opToActionUser = {
add: EVENT_USER_ADD,
Expand Down Expand Up @@ -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':
Expand Down Expand Up @@ -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(),
};
Expand Down

0 comments on commit 2407f3f

Please sign in to comment.