Better send state for unregistered recipients
This commit is contained in:
parent
90734e306c
commit
629b5c3f6a
5 changed files with 14 additions and 4 deletions
|
@ -492,7 +492,7 @@ export async function sendStory(
|
|||
return acc;
|
||||
}
|
||||
|
||||
if (recipient.isUnregistered()) {
|
||||
if (recipient.isEverUnregistered()) {
|
||||
if (!isSent(oldSendState.status)) {
|
||||
// We should have filtered this out on initial send, but we'll drop them from
|
||||
// send list here if needed.
|
||||
|
|
|
@ -52,6 +52,7 @@ import { strictAssert } from '../util/assert';
|
|||
import { isConversationMuted } from '../util/isConversationMuted';
|
||||
import { isConversationSMSOnly } from '../util/isConversationSMSOnly';
|
||||
import {
|
||||
isConversationEverUnregistered,
|
||||
isConversationUnregistered,
|
||||
isConversationUnregisteredAndStale,
|
||||
} from '../util/isConversationUnregistered';
|
||||
|
@ -785,7 +786,7 @@ export class ConversationModel extends window.Backbone
|
|||
}
|
||||
|
||||
isEverUnregistered(): boolean {
|
||||
return Boolean(this.get('discoveredUnregisteredAt'));
|
||||
return isConversationEverUnregistered(this.attributes);
|
||||
}
|
||||
|
||||
isUnregistered(): boolean {
|
||||
|
|
|
@ -6,13 +6,16 @@ import type { ConversationModel } from '../models/conversations';
|
|||
import type { ConversationType } from '../state/ducks/conversations';
|
||||
import { isInSystemContacts } from './isInSystemContacts';
|
||||
import { isDirectConversation } from './whatTypeOfConversation';
|
||||
import { isConversationEverUnregistered } from './isConversationUnregistered';
|
||||
|
||||
export function isSignalConnection(
|
||||
conversation: ConversationType | ConversationAttributesType
|
||||
): boolean {
|
||||
return (
|
||||
isDirectConversation(conversation) &&
|
||||
(conversation.profileSharing || isInSystemContacts(conversation))
|
||||
(conversation.profileSharing || isInSystemContacts(conversation)) &&
|
||||
conversation.uuid !== undefined &&
|
||||
!isConversationEverUnregistered(conversation)
|
||||
);
|
||||
}
|
||||
|
||||
|
|
|
@ -6,6 +6,12 @@ import { HOUR, MONTH } from './durations';
|
|||
|
||||
const SIX_HOURS = 6 * HOUR;
|
||||
|
||||
export function isConversationEverUnregistered({
|
||||
discoveredUnregisteredAt,
|
||||
}: Readonly<{ discoveredUnregisteredAt?: number }>): boolean {
|
||||
return discoveredUnregisteredAt !== undefined;
|
||||
}
|
||||
|
||||
export function isConversationUnregistered({
|
||||
discoveredUnregisteredAt,
|
||||
}: Readonly<{ discoveredUnregisteredAt?: number }>): boolean {
|
||||
|
|
|
@ -96,7 +96,7 @@ export async function sendStoryMessage(
|
|||
return acc;
|
||||
}
|
||||
|
||||
if (convo.isUnregistered()) {
|
||||
if (convo.isEverUnregistered()) {
|
||||
return acc;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue