mirror of
https://github.com/signalapp/Signal-Desktop.git
synced 2026-04-18 15:45:39 +01:00
Admin Delete
This commit is contained in:
@@ -5,8 +5,11 @@ import type {
|
||||
ConversationAttributesType,
|
||||
ReadonlyMessageAttributesType,
|
||||
} from '../model-types.d.ts';
|
||||
import type { AciString } from '../types/ServiceId.std.js';
|
||||
import { isIncoming, isOutgoing } from '../state/selectors/message.preload.js';
|
||||
import { isAciString } from './isAciString.std.js';
|
||||
import { getTitle } from './getTitle.preload.js';
|
||||
import { itemStorage } from '../textsecure/Storage.preload.js';
|
||||
|
||||
function getIncomingContact(
|
||||
messageAttributes: ReadonlyMessageAttributesType
|
||||
@@ -23,6 +26,7 @@ function getIncomingContact(
|
||||
.attributes;
|
||||
}
|
||||
|
||||
/** @deprecated Use getMessageAuthorAci instead */
|
||||
export function getMessageAuthorText(
|
||||
messageAttributes?: ReadonlyMessageAttributesType
|
||||
): string | undefined {
|
||||
@@ -48,3 +52,18 @@ export function getMessageAuthorText(
|
||||
// it might be a group notification, so we return undefined
|
||||
return undefined;
|
||||
}
|
||||
|
||||
export function getMessageAuthorAci(
|
||||
messageAttributes: ReadonlyMessageAttributesType
|
||||
): AciString | null {
|
||||
if (isOutgoing(messageAttributes)) {
|
||||
return itemStorage.user.getCheckedAci();
|
||||
}
|
||||
if (isIncoming(messageAttributes)) {
|
||||
const { sourceServiceId } = messageAttributes;
|
||||
if (isAciString(sourceServiceId)) {
|
||||
return sourceServiceId;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user