Admin Delete

This commit is contained in:
Jamie
2026-02-27 11:55:02 -08:00
committed by Yash
parent b71b5570d3
commit e424610cc2
67 changed files with 2328 additions and 569 deletions

View File

@@ -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;
}