mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-23 21:58:12 +00:00
mattermost: fix DM media upload for unprefixed user IDs (#29925)
Merged via squash.
Prepared head SHA: 5cffcb072c
Co-authored-by: teconomix <6959299+teconomix@users.noreply.github.com>
Co-authored-by: mukhtharcm <56378562+mukhtharcm@users.noreply.github.com>
Reviewed-by: @mukhtharcm
This commit is contained in:
@@ -11,6 +11,7 @@ import {
|
||||
} from "../../infra/outbound/outbound-session.js";
|
||||
import { normalizeReplyPayloadsForDelivery } from "../../infra/outbound/payloads.js";
|
||||
import { buildOutboundSessionContext } from "../../infra/outbound/session-context.js";
|
||||
import { maybeResolveIdLikeTarget } from "../../infra/outbound/target-resolver.js";
|
||||
import { resolveOutboundTarget } from "../../infra/outbound/targets.js";
|
||||
import { normalizePollInput } from "../../polls.js";
|
||||
import {
|
||||
@@ -194,6 +195,13 @@ export const sendHandlers: GatewayRequestHandlers = {
|
||||
meta: { channel },
|
||||
};
|
||||
}
|
||||
const idLikeTarget = await maybeResolveIdLikeTarget({
|
||||
cfg,
|
||||
channel,
|
||||
input: resolved.to,
|
||||
accountId,
|
||||
});
|
||||
const deliveryTarget = idLikeTarget?.to ?? resolved.to;
|
||||
const outboundDeps = context.deps ? createOutboundSendDeps(context.deps) : undefined;
|
||||
const mirrorPayloads = normalizeReplyPayloadsForDelivery([
|
||||
{ text: message, mediaUrl, mediaUrls },
|
||||
@@ -225,7 +233,8 @@ export const sendHandlers: GatewayRequestHandlers = {
|
||||
channel,
|
||||
agentId: effectiveAgentId,
|
||||
accountId,
|
||||
target: resolved.to,
|
||||
target: deliveryTarget,
|
||||
resolvedTarget: idLikeTarget,
|
||||
threadId,
|
||||
})
|
||||
: null;
|
||||
@@ -246,7 +255,7 @@ export const sendHandlers: GatewayRequestHandlers = {
|
||||
const results = await deliverOutboundPayloads({
|
||||
cfg,
|
||||
channel: outboundChannel,
|
||||
to: resolved.to,
|
||||
to: deliveryTarget,
|
||||
accountId,
|
||||
payloads: [{ text: message, mediaUrl, mediaUrls }],
|
||||
session: outboundSession,
|
||||
|
||||
Reference in New Issue
Block a user