mirror of
https://github.com/oxen-io/session-desktop.git
synced 2023-12-14 02:12:57 +01:00
fix: simplify checking isFromMe for communities in getMessageQuoteProps selector
This commit is contained in:
parent
391db5590e
commit
70156c33b3
|
@ -40,9 +40,7 @@ import { MessageReactsSelectorProps } from '../../components/conversation/messag
|
||||||
import { filter, isEmpty, pick, sortBy } from 'lodash';
|
import { filter, isEmpty, pick, sortBy } from 'lodash';
|
||||||
import { processQuoteAttachment } from '../../models/message';
|
import { processQuoteAttachment } from '../../models/message';
|
||||||
import { PubKey } from '../../session/types';
|
import { PubKey } from '../../session/types';
|
||||||
import { OpenGroupData } from '../../data/opengroups';
|
import { isUsAnySogsFromCache } from '../../session/apis/open_group_api/sogsv3/knownBlindedkeys';
|
||||||
import { roomHasBlindEnabled } from '../../session/apis/open_group_api/sogsv3/sogsV3Capabilities';
|
|
||||||
import { findCachedBlindedIdFromUnblinded } from '../../session/apis/open_group_api/sogsv3/knownBlindedkeys';
|
|
||||||
import { MessageModelType } from '../../models/messageType';
|
import { MessageModelType } from '../../models/messageType';
|
||||||
|
|
||||||
export const getConversations = (state: StateType): ConversationsStateType => state.conversations;
|
export const getConversations = (state: StateType): ConversationsStateType => state.conversations;
|
||||||
|
@ -1038,21 +1036,12 @@ export const getMessageQuoteProps = createSelector(
|
||||||
return quoteNotFound;
|
return quoteNotFound;
|
||||||
}
|
}
|
||||||
|
|
||||||
const attachment = sourceMsgProps.attachments && sourceMsgProps.attachments[0];
|
|
||||||
|
|
||||||
if (convo.isPublic && PubKey.hasBlindedPrefix(sourceMsgProps.sender)) {
|
if (convo.isPublic && PubKey.hasBlindedPrefix(sourceMsgProps.sender)) {
|
||||||
const room = OpenGroupData.getV2OpenGroupRoom(sourceMsgProps.convoId);
|
isFromMe = isUsAnySogsFromCache(sourceMsgProps.sender);
|
||||||
if (room && roomHasBlindEnabled(room)) {
|
|
||||||
const usFromCache = findCachedBlindedIdFromUnblinded(
|
|
||||||
UserUtils.getOurPubKeyStrFromCache(),
|
|
||||||
room.serverPublicKey
|
|
||||||
);
|
|
||||||
if (usFromCache && usFromCache === sourceMsgProps.sender) {
|
|
||||||
isFromMe = true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const attachment = sourceMsgProps.attachments && sourceMsgProps.attachments[0];
|
||||||
|
|
||||||
const quote: PropsForQuote = {
|
const quote: PropsForQuote = {
|
||||||
text: sourceMsgProps.text,
|
text: sourceMsgProps.text,
|
||||||
attachment: attachment ? processQuoteAttachment(attachment) : undefined,
|
attachment: attachment ? processQuoteAttachment(attachment) : undefined,
|
||||||
|
|
Loading…
Reference in a new issue