Sync MyStories using the ID not the name
This commit is contained in:
parent
6d1a27be5a
commit
782838c591
5 changed files with 14 additions and 18 deletions
|
@ -2715,7 +2715,7 @@ export async function startApp(): Promise<void> {
|
||||||
|
|
||||||
const partialConversation: ValidateConversationType = {
|
const partialConversation: ValidateConversationType = {
|
||||||
e164: details.number,
|
e164: details.number,
|
||||||
uuid: UUID.fromString(details.uuid),
|
uuid: UUID.cast(details.uuid),
|
||||||
type: 'private',
|
type: 'private',
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -3454,9 +3454,7 @@ export async function startApp(): Promise<void> {
|
||||||
serverTimestamp: data.serverTimestamp,
|
serverTimestamp: data.serverTimestamp,
|
||||||
source: data.source,
|
source: data.source,
|
||||||
sourceDevice: data.sourceDevice,
|
sourceDevice: data.sourceDevice,
|
||||||
sourceUuid: data.sourceUuid
|
sourceUuid: data.sourceUuid ? UUID.cast(data.sourceUuid) : undefined,
|
||||||
? UUID.fromString(data.sourceUuid)
|
|
||||||
: undefined,
|
|
||||||
timestamp: data.timestamp,
|
timestamp: data.timestamp,
|
||||||
type: data.message.isStory ? 'story' : 'incoming',
|
type: data.message.isStory ? 'story' : 'incoming',
|
||||||
unidentifiedDeliveryReceived: data.unidentifiedDeliveryReceived,
|
unidentifiedDeliveryReceived: data.unidentifiedDeliveryReceived,
|
||||||
|
|
|
@ -239,9 +239,7 @@ export const StoriesSettingsModal = ({
|
||||||
return undefined;
|
return undefined;
|
||||||
}
|
}
|
||||||
|
|
||||||
const isSelected = selectedConversationUuids.has(
|
const isSelected = selectedConversationUuids.has(UUID.cast(contact.uuid));
|
||||||
UUID.fromString(contact.uuid)
|
|
||||||
);
|
|
||||||
|
|
||||||
return {
|
return {
|
||||||
type: RowType.ContactCheckbox,
|
type: RowType.ContactCheckbox,
|
||||||
|
|
|
@ -44,13 +44,15 @@ import * as preferredReactionEmoji from '../reactions/preferredReactionEmoji';
|
||||||
import { SignalService as Proto } from '../protobuf';
|
import { SignalService as Proto } from '../protobuf';
|
||||||
import * as log from '../logging/log';
|
import * as log from '../logging/log';
|
||||||
import type { UUIDStringType } from '../types/UUID';
|
import type { UUIDStringType } from '../types/UUID';
|
||||||
import { MY_STORIES_ID } from '../types/Stories';
|
|
||||||
import * as Stickers from '../types/Stickers';
|
import * as Stickers from '../types/Stickers';
|
||||||
import type {
|
import type {
|
||||||
StoryDistributionWithMembersType,
|
StoryDistributionWithMembersType,
|
||||||
StickerPackInfoType,
|
StickerPackInfoType,
|
||||||
} from '../sql/Interface';
|
} from '../sql/Interface';
|
||||||
import dataInterface from '../sql/Client';
|
import dataInterface from '../sql/Client';
|
||||||
|
import { MY_STORIES_ID } from '../types/Stories';
|
||||||
|
|
||||||
|
const MY_STORIES_BYTES = uuidToBytes(MY_STORIES_ID);
|
||||||
|
|
||||||
type RecordClass =
|
type RecordClass =
|
||||||
| Proto.IAccountRecord
|
| Proto.IAccountRecord
|
||||||
|
@ -1265,10 +1267,12 @@ export async function mergeStoryDistributionListRecord(
|
||||||
|
|
||||||
const details: Array<string> = [];
|
const details: Array<string> = [];
|
||||||
|
|
||||||
const listId =
|
const listId = Bytes.areEqual(
|
||||||
storyDistributionListRecord.name === MY_STORIES_ID
|
MY_STORIES_BYTES,
|
||||||
? MY_STORIES_ID
|
storyDistributionListRecord.identifier
|
||||||
: bytesToUuid(storyDistributionListRecord.identifier);
|
)
|
||||||
|
? MY_STORIES_ID
|
||||||
|
: bytesToUuid(storyDistributionListRecord.identifier);
|
||||||
|
|
||||||
if (!listId) {
|
if (!listId) {
|
||||||
throw new Error('Could not parse distribution list id');
|
throw new Error('Could not parse distribution list id');
|
||||||
|
@ -1279,7 +1283,7 @@ export async function mergeStoryDistributionListRecord(
|
||||||
|
|
||||||
const remoteListMembers: Array<UUIDStringType> = (
|
const remoteListMembers: Array<UUIDStringType> = (
|
||||||
storyDistributionListRecord.recipientUuids || []
|
storyDistributionListRecord.recipientUuids || []
|
||||||
).map(UUID.fromString);
|
).map(UUID.cast);
|
||||||
|
|
||||||
if (storyDistributionListRecord.__unknownFields) {
|
if (storyDistributionListRecord.__unknownFields) {
|
||||||
details.push('adding unknown fields');
|
details.push('adding unknown fields');
|
||||||
|
|
|
@ -77,8 +77,4 @@ export class UUID {
|
||||||
}
|
}
|
||||||
return new UUID(`${padded}-0000-4000-8000-${'0'.repeat(12)}`);
|
return new UUID(`${padded}-0000-4000-8000-${'0'.repeat(12)}`);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static fromString(value: string): UUIDStringType {
|
|
||||||
return new UUID(value).toString();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -84,7 +84,7 @@ export async function sendStoryMessage(
|
||||||
return acc;
|
return acc;
|
||||||
}
|
}
|
||||||
|
|
||||||
const uuid = UUID.fromString(id);
|
const uuid = UUID.cast(id);
|
||||||
if (inBlockList.has(uuid)) {
|
if (inBlockList.has(uuid)) {
|
||||||
return acc;
|
return acc;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue