import {
comparableChannelTargetsShareRoute,
parseExplicitTargetForLoadedChannel,
resolveComparableTargetForLoadedChannel,
} from "../../channels/plugins/target-parsing-loaded.js"; import type { ChannelOutboundTargetMode } from "../../channels/plugins/types.public.js"; import type { SessionEntry } from "../../config/sessions.js"; import { deliveryContextFromSession } from "../../utils/delivery-context.shared.js"; import {
isDeliverableMessageChannel,
normalizeMessageChannel,
} from "../../utils/message-channel-core.js"; import type {
DeliverableMessageChannel,
GatewayMessageChannel,
} from "../../utils/message-channel-normalize.js";
export type SessionDeliveryTarget = {
channel?: DeliverableMessageChannel;
to?: string;
accountId?: string;
threadId?: string | number; /** Whether threadId came from an explicit source (config/param/:topic: parsing) vs session history. */
threadIdExplicit?: boolean;
mode: ChannelOutboundTargetMode;
lastChannel?: DeliverableMessageChannel;
lastTo?: string;
lastAccountId?: string;
lastThreadId?: string | number;
};
function parseExplicitTargetWithPlugin(params: {
channel?: DeliverableMessageChannel;
fallbackChannel?: DeliverableMessageChannel;
raw?: string;
}) { const raw = params.raw?.trim(); if (!raw) { returnnull;
} const provider = params.channel ?? params.fallbackChannel; if (!provider) { returnnull;
} return parseExplicitTargetForLoadedChannel(provider, raw);
}
let to = explicitTo; if (!to && lastTo) { if (channel && channel === lastChannel) {
to = lastTo;
} elseif (params.allowMismatchedLastTo) {
to = lastTo;
}
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.