fix slaveMessages shown as someone else messages pubchats

When sending a message from a secondary device to a pubchat the
primary device would display this message on the left side on the
conversation view. It was due to the fact that the slaveDevices was not
built correctly.
pull/1094/head
Audric Ackermann 5 years ago
parent 4e1e7132d4
commit 026844e40b
No known key found for this signature in database
GPG Key ID: 999F434D76324AD4

@ -1062,6 +1062,8 @@ export class Message extends React.PureComponent<Props, State> {
selected,
multiSelectMode,
conversationType,
isPublic,
text,
} = this.props;
const { expired, expiring } = this.state;
@ -1084,15 +1086,15 @@ export class Message extends React.PureComponent<Props, State> {
// We parse the message later, but we still need to do an early check
// to see if the message mentions us, so we can display the entire
// message differently
const mentions = this.props.text
? this.props.text.match(window.pubkeyPattern)
const mentions = text
? text.match(window.pubkeyPattern)
: [];
const mentionMe =
mentions &&
mentions.some(m => m.slice(1) === window.lokiPublicChatAPI.ourKey);
const isIncoming = direction === 'incoming';
const shouldHightlight = mentionMe && isIncoming && this.props.isPublic;
const shouldHightlight = mentionMe && isIncoming && isPublic;
const divClasses = ['loki-message-wrapper'];
if (shouldHightlight) {

Loading…
Cancel
Save