refactor: ttl_config to config_message

inside of TTL_DEFAULT. This is more readable and explicit
pull/2971/head
William Grant 2 years ago
parent d4aacd3159
commit 8838477e34

@ -74,7 +74,7 @@ async function buildRetrieveRequest(
); );
if (configHashesToBump?.length) { if (configHashesToBump?.length) {
const expiry = GetNetworkTime.getNowWithNetworkOffset() + TTL_DEFAULT.TTL_CONFIG; const expiry = GetNetworkTime.getNowWithNetworkOffset() + TTL_DEFAULT.CONFIG_MESSAGE;
const signResult = await SnodeSignature.generateUpdateExpirySignature({ const signResult = await SnodeSignature.generateUpdateExpirySignature({
shortenOrExtend: '', shortenOrExtend: '',
timestamp: expiry, timestamp: expiry,

@ -23,7 +23,7 @@ export const TTL_DEFAULT = {
/** 14 days */ /** 14 days */
TTL_MAX: 14 * DURATION.DAYS, TTL_MAX: 14 * DURATION.DAYS,
/** 30 days */ /** 30 days */
TTL_CONFIG: 30 * DURATION.DAYS, CONFIG_MESSAGE: 30 * DURATION.DAYS,
}; };
export const SWARM_POLLING_TIMEOUT = { export const SWARM_POLLING_TIMEOUT = {

@ -1,10 +1,10 @@
// this is not a very good name, but a configuration message is a message sent to our other devices so sync our current public and closed groups // this is not a very good name, but a configuration message is a message sent to our other devices so sync our current public and closed groups
import Long from 'long'; import Long from 'long';
import { SignalService } from '../../../../protobuf';
import { MessageParams } from '../Message';
import { ContentMessage } from '..'; import { ContentMessage } from '..';
import { SignalService } from '../../../../protobuf';
import { TTL_DEFAULT } from '../../../constants'; import { TTL_DEFAULT } from '../../../constants';
import { MessageParams } from '../Message';
interface SharedConfigParams extends MessageParams { interface SharedConfigParams extends MessageParams {
seqno: Long; seqno: Long;
@ -31,7 +31,7 @@ export class SharedConfigMessage extends ContentMessage {
} }
public ttl(): number { public ttl(): number {
return TTL_DEFAULT.TTL_CONFIG; return TTL_DEFAULT.CONFIG_MESSAGE;
} }
protected sharedConfigProto(): SignalService.SharedConfigMessage { protected sharedConfigProto(): SignalService.SharedConfigMessage {

Loading…
Cancel
Save