remove isUnidentifiedDelivery
This commit is contained in:
parent
c5ad206239
commit
79028ebaeb
|
@ -1071,25 +1071,10 @@
|
|||
}
|
||||
function onConfiguration(ev) {
|
||||
const { configuration } = ev;
|
||||
const {
|
||||
readReceipts,
|
||||
typingIndicators,
|
||||
unidentifiedDeliveryIndicators,
|
||||
linkPreviews,
|
||||
} = configuration;
|
||||
const { readReceipts, typingIndicators, linkPreviews } = configuration;
|
||||
|
||||
storage.put('read-receipt-setting', readReceipts);
|
||||
|
||||
if (
|
||||
unidentifiedDeliveryIndicators === true ||
|
||||
unidentifiedDeliveryIndicators === false
|
||||
) {
|
||||
storage.put(
|
||||
'unidentifiedDeliveryIndicators',
|
||||
unidentifiedDeliveryIndicators
|
||||
);
|
||||
}
|
||||
|
||||
if (typingIndicators === true || typingIndicators === false) {
|
||||
storage.put('typing-indicators-setting', typingIndicators);
|
||||
}
|
||||
|
|
|
@ -86,9 +86,6 @@
|
|||
if (this.isPublic) {
|
||||
this.set('profileSharing', true);
|
||||
}
|
||||
|
||||
this.unset('unidentifiedDelivery');
|
||||
this.unset('unidentifiedDeliveryUnrestricted');
|
||||
this.unset('hasFetchedProfile');
|
||||
this.unset('tokens');
|
||||
|
||||
|
|
|
@ -677,25 +677,10 @@
|
|||
: null,
|
||||
};
|
||||
},
|
||||
isUnidentifiedDelivery(contactId, lookup) {
|
||||
if (this.isIncoming()) {
|
||||
return this.get('unidentifiedDeliveryReceived');
|
||||
}
|
||||
|
||||
return Boolean(lookup[contactId]);
|
||||
},
|
||||
async getPropsForMessageDetail() {
|
||||
const newIdentity = i18n('newIdentity');
|
||||
const OUTGOING_KEY_ERROR = 'OutgoingIdentityKeyError';
|
||||
|
||||
const unidentifiedLookup = (
|
||||
this.get('unidentifiedDeliveries') || []
|
||||
).reduce((accumulator, item) => {
|
||||
// eslint-disable-next-line no-param-reassign
|
||||
accumulator[item] = true;
|
||||
return accumulator;
|
||||
}, Object.create(null));
|
||||
|
||||
// We include numbers we didn't successfully send to so we can display errors.
|
||||
// Older messages don't have the recipients included on the message, so we fall
|
||||
// back to the conversation's current recipients
|
||||
|
@ -726,9 +711,6 @@
|
|||
const isOutgoingKeyError = Boolean(
|
||||
_.find(errorsForContact, error => error.name === OUTGOING_KEY_ERROR)
|
||||
);
|
||||
const isUnidentifiedDelivery =
|
||||
storage.get('unidentifiedDeliveryIndicators') &&
|
||||
this.isUnidentifiedDelivery(id, unidentifiedLookup);
|
||||
|
||||
const contact = this.findAndFormatContact(id);
|
||||
return {
|
||||
|
@ -738,7 +720,6 @@
|
|||
status: this.getStatus(id) || this.getMessagePropStatus(),
|
||||
errors: errorsForContact,
|
||||
isOutgoingKeyError,
|
||||
isUnidentifiedDelivery,
|
||||
isPrimaryDevice: true,
|
||||
profileName: contact.profileName,
|
||||
};
|
||||
|
|
|
@ -15,7 +15,6 @@ interface Contact {
|
|||
avatarPath?: string;
|
||||
color: string;
|
||||
isOutgoingKeyError: boolean;
|
||||
isUnidentifiedDelivery: boolean;
|
||||
|
||||
errors?: Array<Error>;
|
||||
|
||||
|
@ -89,9 +88,6 @@ export class MessageDetail extends React.Component<Props> {
|
|||
)}
|
||||
/>
|
||||
) : null;
|
||||
const unidentifiedDeliveryComponent = contact.isUnidentifiedDelivery ? (
|
||||
<div className="module-message-detail__contact__unidentified-delivery-icon" />
|
||||
) : null;
|
||||
|
||||
return (
|
||||
<div key={contact.phoneNumber} className="module-message-detail__contact">
|
||||
|
@ -113,7 +109,6 @@ export class MessageDetail extends React.Component<Props> {
|
|||
))}
|
||||
</div>
|
||||
{errorComponent}
|
||||
{unidentifiedDeliveryComponent}
|
||||
{statusComponent}
|
||||
</div>
|
||||
);
|
||||
|
|
|
@ -311,7 +311,6 @@ export async function handleDataMessage(
|
|||
sourceDevice: 1,
|
||||
timestamp: _.toNumber(envelope.timestamp),
|
||||
receivedAt: envelope.receivedAt,
|
||||
unidentifiedDeliveryReceived: envelope.unidentifiedDeliveryReceived,
|
||||
message,
|
||||
};
|
||||
|
||||
|
@ -414,7 +413,6 @@ interface MessageCreationData {
|
|||
isPublic: boolean;
|
||||
receivedAt: number;
|
||||
sourceDevice: number; // always 1 isn't it?
|
||||
unidentifiedDeliveryReceived: any; // ???
|
||||
source: boolean;
|
||||
serverId: string;
|
||||
message: any;
|
||||
|
@ -432,7 +430,6 @@ export function initIncomingMessage(data: MessageCreationData): MessageModel {
|
|||
isPublic,
|
||||
receivedAt,
|
||||
sourceDevice,
|
||||
unidentifiedDeliveryReceived,
|
||||
source,
|
||||
serverId,
|
||||
message,
|
||||
|
@ -456,7 +453,6 @@ export function initIncomingMessage(data: MessageCreationData): MessageModel {
|
|||
serverTimestamp,
|
||||
received_at: receivedAt || Date.now(),
|
||||
conversationId: groupId ?? source,
|
||||
unidentifiedDeliveryReceived, // +
|
||||
type,
|
||||
direction: 'incoming', // +
|
||||
unread: 1, // +
|
||||
|
@ -588,11 +584,7 @@ export async function handleMessageEvent(event: MessageEvent): Promise<void> {
|
|||
|
||||
const isOurDevice = await UserUtils.isUs(source);
|
||||
|
||||
const shouldSendReceipt =
|
||||
isIncoming &&
|
||||
data.unidentifiedDeliveryReceived &&
|
||||
!isGroupMessage &&
|
||||
!isOurDevice;
|
||||
const shouldSendReceipt = isIncoming && !isGroupMessage && !isOurDevice;
|
||||
|
||||
if (shouldSendReceipt) {
|
||||
sendDeliveryReceipt(source, data.timestamp);
|
||||
|
|
|
@ -11,6 +11,5 @@ export interface Quote {
|
|||
export interface EnvelopePlus extends SignalService.Envelope {
|
||||
senderIdentity: string; // Sender's pubkey after it's been decrypted (for medium groups)
|
||||
receivedAt: number; // We only seem to set this for public messages?
|
||||
unidentifiedDeliveryReceived: boolean;
|
||||
id: string;
|
||||
}
|
||||
|
|
|
@ -416,7 +416,6 @@ const toPickFromMessageModel = [
|
|||
'isIncoming',
|
||||
'findAndFormatContact',
|
||||
'findContact',
|
||||
'isUnidentifiedDelivery',
|
||||
'getStatus',
|
||||
'getMessagePropStatus',
|
||||
'hasErrors',
|
||||
|
|
Loading…
Reference in New Issue