remove isUnidentifiedDelivery

pull/1459/head
Audric Ackermann 4 years ago
parent c5ad206239
commit 79028ebaeb
No known key found for this signature in database
GPG Key ID: 999F434D76324AD4

@ -1071,25 +1071,10 @@
} }
function onConfiguration(ev) { function onConfiguration(ev) {
const { configuration } = ev; const { configuration } = ev;
const { const { readReceipts, typingIndicators, linkPreviews } = configuration;
readReceipts,
typingIndicators,
unidentifiedDeliveryIndicators,
linkPreviews,
} = configuration;
storage.put('read-receipt-setting', readReceipts); storage.put('read-receipt-setting', readReceipts);
if (
unidentifiedDeliveryIndicators === true ||
unidentifiedDeliveryIndicators === false
) {
storage.put(
'unidentifiedDeliveryIndicators',
unidentifiedDeliveryIndicators
);
}
if (typingIndicators === true || typingIndicators === false) { if (typingIndicators === true || typingIndicators === false) {
storage.put('typing-indicators-setting', typingIndicators); storage.put('typing-indicators-setting', typingIndicators);
} }

@ -86,9 +86,6 @@
if (this.isPublic) { if (this.isPublic) {
this.set('profileSharing', true); this.set('profileSharing', true);
} }
this.unset('unidentifiedDelivery');
this.unset('unidentifiedDeliveryUnrestricted');
this.unset('hasFetchedProfile'); this.unset('hasFetchedProfile');
this.unset('tokens'); this.unset('tokens');

@ -677,25 +677,10 @@
: null, : null,
}; };
}, },
isUnidentifiedDelivery(contactId, lookup) {
if (this.isIncoming()) {
return this.get('unidentifiedDeliveryReceived');
}
return Boolean(lookup[contactId]);
},
async getPropsForMessageDetail() { async getPropsForMessageDetail() {
const newIdentity = i18n('newIdentity'); const newIdentity = i18n('newIdentity');
const OUTGOING_KEY_ERROR = 'OutgoingIdentityKeyError'; 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. // 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 // Older messages don't have the recipients included on the message, so we fall
// back to the conversation's current recipients // back to the conversation's current recipients
@ -726,9 +711,6 @@
const isOutgoingKeyError = Boolean( const isOutgoingKeyError = Boolean(
_.find(errorsForContact, error => error.name === OUTGOING_KEY_ERROR) _.find(errorsForContact, error => error.name === OUTGOING_KEY_ERROR)
); );
const isUnidentifiedDelivery =
storage.get('unidentifiedDeliveryIndicators') &&
this.isUnidentifiedDelivery(id, unidentifiedLookup);
const contact = this.findAndFormatContact(id); const contact = this.findAndFormatContact(id);
return { return {
@ -738,7 +720,6 @@
status: this.getStatus(id) || this.getMessagePropStatus(), status: this.getStatus(id) || this.getMessagePropStatus(),
errors: errorsForContact, errors: errorsForContact,
isOutgoingKeyError, isOutgoingKeyError,
isUnidentifiedDelivery,
isPrimaryDevice: true, isPrimaryDevice: true,
profileName: contact.profileName, profileName: contact.profileName,
}; };

@ -15,7 +15,6 @@ interface Contact {
avatarPath?: string; avatarPath?: string;
color: string; color: string;
isOutgoingKeyError: boolean; isOutgoingKeyError: boolean;
isUnidentifiedDelivery: boolean;
errors?: Array<Error>; errors?: Array<Error>;
@ -89,9 +88,6 @@ export class MessageDetail extends React.Component<Props> {
)} )}
/> />
) : null; ) : null;
const unidentifiedDeliveryComponent = contact.isUnidentifiedDelivery ? (
<div className="module-message-detail__contact__unidentified-delivery-icon" />
) : null;
return ( return (
<div key={contact.phoneNumber} className="module-message-detail__contact"> <div key={contact.phoneNumber} className="module-message-detail__contact">
@ -113,7 +109,6 @@ export class MessageDetail extends React.Component<Props> {
))} ))}
</div> </div>
{errorComponent} {errorComponent}
{unidentifiedDeliveryComponent}
{statusComponent} {statusComponent}
</div> </div>
); );

@ -311,7 +311,6 @@ export async function handleDataMessage(
sourceDevice: 1, sourceDevice: 1,
timestamp: _.toNumber(envelope.timestamp), timestamp: _.toNumber(envelope.timestamp),
receivedAt: envelope.receivedAt, receivedAt: envelope.receivedAt,
unidentifiedDeliveryReceived: envelope.unidentifiedDeliveryReceived,
message, message,
}; };
@ -414,7 +413,6 @@ interface MessageCreationData {
isPublic: boolean; isPublic: boolean;
receivedAt: number; receivedAt: number;
sourceDevice: number; // always 1 isn't it? sourceDevice: number; // always 1 isn't it?
unidentifiedDeliveryReceived: any; // ???
source: boolean; source: boolean;
serverId: string; serverId: string;
message: any; message: any;
@ -432,7 +430,6 @@ export function initIncomingMessage(data: MessageCreationData): MessageModel {
isPublic, isPublic,
receivedAt, receivedAt,
sourceDevice, sourceDevice,
unidentifiedDeliveryReceived,
source, source,
serverId, serverId,
message, message,
@ -456,7 +453,6 @@ export function initIncomingMessage(data: MessageCreationData): MessageModel {
serverTimestamp, serverTimestamp,
received_at: receivedAt || Date.now(), received_at: receivedAt || Date.now(),
conversationId: groupId ?? source, conversationId: groupId ?? source,
unidentifiedDeliveryReceived, // +
type, type,
direction: 'incoming', // + direction: 'incoming', // +
unread: 1, // + unread: 1, // +
@ -588,11 +584,7 @@ export async function handleMessageEvent(event: MessageEvent): Promise<void> {
const isOurDevice = await UserUtils.isUs(source); const isOurDevice = await UserUtils.isUs(source);
const shouldSendReceipt = const shouldSendReceipt = isIncoming && !isGroupMessage && !isOurDevice;
isIncoming &&
data.unidentifiedDeliveryReceived &&
!isGroupMessage &&
!isOurDevice;
if (shouldSendReceipt) { if (shouldSendReceipt) {
sendDeliveryReceipt(source, data.timestamp); sendDeliveryReceipt(source, data.timestamp);

@ -11,6 +11,5 @@ export interface Quote {
export interface EnvelopePlus extends SignalService.Envelope { export interface EnvelopePlus extends SignalService.Envelope {
senderIdentity: string; // Sender's pubkey after it's been decrypted (for medium groups) senderIdentity: string; // Sender's pubkey after it's been decrypted (for medium groups)
receivedAt: number; // We only seem to set this for public messages? receivedAt: number; // We only seem to set this for public messages?
unidentifiedDeliveryReceived: boolean;
id: string; id: string;
} }

@ -416,7 +416,6 @@ const toPickFromMessageModel = [
'isIncoming', 'isIncoming',
'findAndFormatContact', 'findAndFormatContact',
'findContact', 'findContact',
'isUnidentifiedDelivery',
'getStatus', 'getStatus',
'getMessagePropStatus', 'getMessagePropStatus',
'hasErrors', 'hasErrors',

Loading…
Cancel
Save