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
1 changed files with 4 additions and 15 deletions
|
@ -40,9 +40,7 @@ import { MessageReactsSelectorProps } from '../../components/conversation/messag
|
|||
import { filter, isEmpty, pick, sortBy } from 'lodash';
|
||||
import { processQuoteAttachment } from '../../models/message';
|
||||
import { PubKey } from '../../session/types';
|
||||
import { OpenGroupData } from '../../data/opengroups';
|
||||
import { roomHasBlindEnabled } from '../../session/apis/open_group_api/sogsv3/sogsV3Capabilities';
|
||||
import { findCachedBlindedIdFromUnblinded } from '../../session/apis/open_group_api/sogsv3/knownBlindedkeys';
|
||||
import { isUsAnySogsFromCache } from '../../session/apis/open_group_api/sogsv3/knownBlindedkeys';
|
||||
import { MessageModelType } from '../../models/messageType';
|
||||
|
||||
export const getConversations = (state: StateType): ConversationsStateType => state.conversations;
|
||||
|
@ -1038,21 +1036,12 @@ export const getMessageQuoteProps = createSelector(
|
|||
return quoteNotFound;
|
||||
}
|
||||
|
||||
const attachment = sourceMsgProps.attachments && sourceMsgProps.attachments[0];
|
||||
|
||||
if (convo.isPublic && PubKey.hasBlindedPrefix(sourceMsgProps.sender)) {
|
||||
const room = OpenGroupData.getV2OpenGroupRoom(sourceMsgProps.convoId);
|
||||
if (room && roomHasBlindEnabled(room)) {
|
||||
const usFromCache = findCachedBlindedIdFromUnblinded(
|
||||
UserUtils.getOurPubKeyStrFromCache(),
|
||||
room.serverPublicKey
|
||||
);
|
||||
if (usFromCache && usFromCache === sourceMsgProps.sender) {
|
||||
isFromMe = true;
|
||||
}
|
||||
}
|
||||
isFromMe = isUsAnySogsFromCache(sourceMsgProps.sender);
|
||||
}
|
||||
|
||||
const attachment = sourceMsgProps.attachments && sourceMsgProps.attachments[0];
|
||||
|
||||
const quote: PropsForQuote = {
|
||||
text: sourceMsgProps.text,
|
||||
attachment: attachment ? processQuoteAttachment(attachment) : undefined,
|
||||
|
|
Loading…
Reference in a new issue