mirror of
https://github.com/signalapp/Signal-Desktop.git
synced 2025-12-27 05:38:12 +00:00
Migrate schema to service ids
This commit is contained in:
committed by
Jamie Kyle
parent
71958f8a01
commit
8b0da36caa
@@ -5,16 +5,20 @@ import type {
|
||||
ConversationAttributesType,
|
||||
MessageAttributesType,
|
||||
} from '../model-types.d';
|
||||
import { getSource, getSourceDevice, getSourceUuid } from '../messages/helpers';
|
||||
import {
|
||||
getSource,
|
||||
getSourceDevice,
|
||||
getSourceServiceId,
|
||||
} from '../messages/helpers';
|
||||
import { isDirectConversation, isGroupV2 } from './whatTypeOfConversation';
|
||||
|
||||
export function getMessageIdForLogging(
|
||||
message: Pick<
|
||||
MessageAttributesType,
|
||||
'type' | 'sourceUuid' | 'sourceDevice' | 'sent_at'
|
||||
'type' | 'sourceServiceId' | 'sourceDevice' | 'sent_at'
|
||||
>
|
||||
): string {
|
||||
const account = getSourceUuid(message) || getSource(message);
|
||||
const account = getSourceServiceId(message) || getSource(message);
|
||||
const device = getSourceDevice(message);
|
||||
const timestamp = message.sent_at;
|
||||
|
||||
@@ -25,8 +29,8 @@ export function getConversationIdForLogging(
|
||||
conversation: ConversationAttributesType
|
||||
): string {
|
||||
if (isDirectConversation(conversation)) {
|
||||
const { uuid, e164, id } = conversation;
|
||||
return `${uuid || e164} (${id})`;
|
||||
const { serviceId, pni, e164, id } = conversation;
|
||||
return `${serviceId || pni || e164} (${id})`;
|
||||
}
|
||||
if (isGroupV2(conversation)) {
|
||||
return `groupv2(${conversation.groupId})`;
|
||||
|
||||
Reference in New Issue
Block a user