Update conversation.unreadCount in just one place, from database

This commit is contained in:
Scott Nonnenberg 2022-05-03 13:24:31 -07:00 committed by GitHub
parent a9c788b689
commit d4e0f6a38d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 12 additions and 6 deletions

View file

@ -22,7 +22,7 @@ import {
import { Address } from '../types/Address';
import { QualifiedAddress } from '../types/QualifiedAddress';
import { UUID } from '../types/UUID';
import { isEnabled } from '../RemoteConfig';
import { getValue, isEnabled } from '../RemoteConfig';
import { isRecord } from './isRecord';
import { isOlderThan } from './timestamp';
@ -55,7 +55,6 @@ import {
multiRecipient410ResponseSchema,
} from '../textsecure/WebAPI';
import { SignalService as Proto } from '../protobuf';
import * as RemoteConfig from '../RemoteConfig';
import { strictAssert } from './assert';
import * as log from '../logging/log';
@ -169,8 +168,8 @@ export async function sendContentMessageToGroup({
if (
isEnabled('desktop.sendSenderKey3') &&
isEnabled('desktop.senderKey.send') &&
ourConversation?.get('capabilities')?.senderKey &&
RemoteConfig.isEnabled('desktop.senderKey.send') &&
sendTarget.isValid()
) {
try {
@ -681,7 +680,7 @@ const MAX_SENDER_KEY_EXPIRE_DURATION = 90 * DAY;
function getSenderKeyExpireDuration(): number {
try {
const parsed = parseIntOrThrow(
window.Signal.RemoteConfig.getValue('desktop.senderKeyMaxAge'),
getValue('desktop.senderKeyMaxAge'),
'getSenderKeyExpireDuration'
);