|
|
@ -8,18 +8,18 @@ import {
|
|
|
|
LegacyGroupMemberInfo,
|
|
|
|
LegacyGroupMemberInfo,
|
|
|
|
UserGroupsWrapperNode,
|
|
|
|
UserGroupsWrapperNode,
|
|
|
|
} from 'libsession_util_nodejs';
|
|
|
|
} from 'libsession_util_nodejs';
|
|
|
|
import { isEmpty, isEqual } from 'lodash';
|
|
|
|
|
|
|
|
import { from_hex } from 'libsodium-wrappers-sumo';
|
|
|
|
import { from_hex } from 'libsodium-wrappers-sumo';
|
|
|
|
|
|
|
|
import { isEmpty, isEqual } from 'lodash';
|
|
|
|
import { CONVERSATION_PRIORITIES } from '../../../models/conversationAttributes';
|
|
|
|
import { CONVERSATION_PRIORITIES } from '../../../models/conversationAttributes';
|
|
|
|
|
|
|
|
import { HexKeyPair } from '../../../receiver/keypairs';
|
|
|
|
import { fromHexToArray } from '../../../session/utils/String';
|
|
|
|
import { fromHexToArray } from '../../../session/utils/String';
|
|
|
|
import { checkTargetMigration, hasDebugEnvVariable } from '../utils';
|
|
|
|
|
|
|
|
import {
|
|
|
|
import {
|
|
|
|
ConfigDumpRow,
|
|
|
|
|
|
|
|
CONFIG_DUMP_TABLE,
|
|
|
|
CONFIG_DUMP_TABLE,
|
|
|
|
|
|
|
|
ConfigDumpRow,
|
|
|
|
maybeArrayJSONtoArray,
|
|
|
|
maybeArrayJSONtoArray,
|
|
|
|
} from '../../../types/sqlSharedTypes';
|
|
|
|
} from '../../../types/sqlSharedTypes';
|
|
|
|
import { HexKeyPair } from '../../../receiver/keypairs';
|
|
|
|
|
|
|
|
import { sqlNode } from '../../sql';
|
|
|
|
import { sqlNode } from '../../sql';
|
|
|
|
|
|
|
|
import { checkTargetMigration, hasDebugEnvVariable } from '../utils';
|
|
|
|
|
|
|
|
|
|
|
|
const targetVersion = 34;
|
|
|
|
const targetVersion = 34;
|
|
|
|
|
|
|
|
|
|
|
@ -99,7 +99,7 @@ function getContactInfoFromDBValues({
|
|
|
|
dbProfileUrl: string | undefined;
|
|
|
|
dbProfileUrl: string | undefined;
|
|
|
|
dbProfileKey: string | undefined;
|
|
|
|
dbProfileKey: string | undefined;
|
|
|
|
dbCreatedAtSeconds: number;
|
|
|
|
dbCreatedAtSeconds: number;
|
|
|
|
expirationMode: string | undefined;
|
|
|
|
expirationMode: DisappearingMessageConversationModeType | undefined;
|
|
|
|
expireTimer: number | undefined;
|
|
|
|
expireTimer: number | undefined;
|
|
|
|
}): ContactInfoSet {
|
|
|
|
}): ContactInfoSet {
|
|
|
|
const wrapperContact: ContactInfoSet = {
|
|
|
|
const wrapperContact: ContactInfoSet = {
|
|
|
@ -111,9 +111,7 @@ function getContactInfoFromDBValues({
|
|
|
|
nickname: dbNickname,
|
|
|
|
nickname: dbNickname,
|
|
|
|
name: dbName,
|
|
|
|
name: dbName,
|
|
|
|
createdAtSeconds: dbCreatedAtSeconds,
|
|
|
|
createdAtSeconds: dbCreatedAtSeconds,
|
|
|
|
expirationMode: expirationMode
|
|
|
|
expirationMode,
|
|
|
|
? (expirationMode as DisappearingMessageConversationModeType)
|
|
|
|
|
|
|
|
: undefined,
|
|
|
|
|
|
|
|
expirationTimerSeconds: !!expireTimer && expireTimer > 0 ? expireTimer : 0,
|
|
|
|
expirationTimerSeconds: !!expireTimer && expireTimer > 0 ? expireTimer : 0,
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
@ -212,7 +210,7 @@ function getLegacyGroupInfoFromDBValues({
|
|
|
|
id: string;
|
|
|
|
id: string;
|
|
|
|
priority: number;
|
|
|
|
priority: number;
|
|
|
|
displayNameInProfile: string | undefined;
|
|
|
|
displayNameInProfile: string | undefined;
|
|
|
|
expirationMode: string | undefined;
|
|
|
|
expirationMode: DisappearingMessageConversationModeType | undefined;
|
|
|
|
expireTimer: number | undefined;
|
|
|
|
expireTimer: number | undefined;
|
|
|
|
encPubkeyHex: string;
|
|
|
|
encPubkeyHex: string;
|
|
|
|
encSeckeyHex: string;
|
|
|
|
encSeckeyHex: string;
|
|
|
@ -232,10 +230,7 @@ function getLegacyGroupInfoFromDBValues({
|
|
|
|
const legacyGroup: LegacyGroupInfo = {
|
|
|
|
const legacyGroup: LegacyGroupInfo = {
|
|
|
|
pubkeyHex: id,
|
|
|
|
pubkeyHex: id,
|
|
|
|
disappearingTimerSeconds:
|
|
|
|
disappearingTimerSeconds:
|
|
|
|
expirationMode &&
|
|
|
|
expirationMode && expirationMode !== 'off' && !!expireTimer && expireTimer > 0
|
|
|
|
(expirationMode as DisappearingMessageConversationModeType) !== 'off' &&
|
|
|
|
|
|
|
|
!!expireTimer &&
|
|
|
|
|
|
|
|
expireTimer > 0
|
|
|
|
|
|
|
|
? expireTimer
|
|
|
|
? expireTimer
|
|
|
|
: 0,
|
|
|
|
: 0,
|
|
|
|
name: displayNameInProfile || '',
|
|
|
|
name: displayNameInProfile || '',
|
|
|
|