Send viewed receipt when you start listening to an audio message

This commit is contained in:
Evan Hahn 2021-08-17 10:43:26 -05:00 committed by GitHub
parent caf544b3a1
commit 75f0cd50be
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
19 changed files with 483 additions and 109 deletions

View file

@ -0,0 +1,22 @@
// Copyright 2021 Signal Messenger, LLC
// SPDX-License-Identifier: AGPL-3.0-only
import type { LoggerType } from '../../logging/log';
import { parseIntWithFallback } from '../../util/parseIntWithFallback';
export function handleCommonJobRequestError(
err: unknown,
log: LoggerType
): void {
if (!(err instanceof Error)) {
throw err;
}
const code = parseIntWithFallback(err.code, -1);
if (code === 508) {
log.info('server responded with 508. Giving up on this job');
return;
}
throw err;
}