Fixes isAccepted logic when calling it for the first time
This commit is contained in:
parent
c3fa6b87fe
commit
d8e6516fb9
2 changed files with 11 additions and 8 deletions
|
@ -1927,11 +1927,13 @@ export class MessageModel extends window.Backbone.Model<MessageAttributesType> {
|
||||||
);
|
);
|
||||||
|
|
||||||
if (
|
if (
|
||||||
type === 'story' &&
|
isStory(message.attributes) &&
|
||||||
!isConversationAccepted(conversation.attributes)
|
!isConversationAccepted(conversation.attributes, {
|
||||||
|
ignoreEmptyConvo: true,
|
||||||
|
})
|
||||||
) {
|
) {
|
||||||
log.info(
|
log.info(
|
||||||
'handleDataMessage: dropping story from !whitelisted',
|
'handleDataMessage: dropping story from !accepted',
|
||||||
this.getSenderIdentifier()
|
this.getSenderIdentifier()
|
||||||
);
|
);
|
||||||
confirm();
|
confirm();
|
||||||
|
@ -2572,9 +2574,7 @@ export class MessageModel extends window.Backbone.Model<MessageAttributesType> {
|
||||||
|
|
||||||
if (
|
if (
|
||||||
this.hasAttachmentDownloads() &&
|
this.hasAttachmentDownloads() &&
|
||||||
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
(conversation.getAccepted() || isOutgoing(message.attributes)) &&
|
||||||
(this.getConversation()!.getAccepted() ||
|
|
||||||
isOutgoing(message.attributes)) &&
|
|
||||||
!shouldHoldOffDownload
|
!shouldHoldOffDownload
|
||||||
) {
|
) {
|
||||||
if (window.attachmentDownloadQueue) {
|
if (window.attachmentDownloadQueue) {
|
||||||
|
|
|
@ -11,7 +11,8 @@ import { isInSystemContacts } from './isInSystemContacts';
|
||||||
* of message requests
|
* of message requests
|
||||||
*/
|
*/
|
||||||
export function isConversationAccepted(
|
export function isConversationAccepted(
|
||||||
conversationAttrs: ConversationAttributesType
|
conversationAttrs: ConversationAttributesType,
|
||||||
|
{ ignoreEmptyConvo = false } = {}
|
||||||
): boolean {
|
): boolean {
|
||||||
const messageRequestsEnabled = window.Signal.RemoteConfig.isEnabled(
|
const messageRequestsEnabled = window.Signal.RemoteConfig.isEnabled(
|
||||||
'desktop.messageRequests'
|
'desktop.messageRequests'
|
||||||
|
@ -40,7 +41,9 @@ export function isConversationAccepted(
|
||||||
const hasNoMessages = (conversationAttrs.messageCount || 0) === 0;
|
const hasNoMessages = (conversationAttrs.messageCount || 0) === 0;
|
||||||
|
|
||||||
const isEmptyPrivateConvo =
|
const isEmptyPrivateConvo =
|
||||||
hasNoMessages && isDirectConversation(conversationAttrs);
|
hasNoMessages &&
|
||||||
|
isDirectConversation(conversationAttrs) &&
|
||||||
|
!ignoreEmptyConvo;
|
||||||
const isEmptyWhitelistedGroup =
|
const isEmptyWhitelistedGroup =
|
||||||
hasNoMessages &&
|
hasNoMessages &&
|
||||||
!isDirectConversation(conversationAttrs) &&
|
!isDirectConversation(conversationAttrs) &&
|
||||||
|
|
Loading…
Add table
Reference in a new issue