mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-08 09:51:22 +00:00
refactor(media): normalize inbound media type defaults (#16228)
This commit is contained in:
committed by
GitHub
parent
e53a221e5c
commit
4b1cadaecb
@@ -561,9 +561,6 @@ export async function prepareSlackMessage(params: {
|
||||
// Use thread starter media if current message has none
|
||||
const effectiveMedia = media ?? threadStarterMedia;
|
||||
const firstMedia = effectiveMedia?.[0];
|
||||
const firstMediaType = firstMedia
|
||||
? (firstMedia.contentType ?? "application/octet-stream")
|
||||
: undefined;
|
||||
|
||||
const inboundHistory =
|
||||
isRoomish && ctx.historyLimit > 0
|
||||
@@ -606,7 +603,7 @@ export async function prepareSlackMessage(params: {
|
||||
Timestamp: message.ts ? Math.round(Number(message.ts) * 1000) : undefined,
|
||||
WasMentioned: isRoomish ? effectiveWasMentioned : undefined,
|
||||
MediaPath: firstMedia?.path,
|
||||
MediaType: firstMediaType,
|
||||
MediaType: firstMedia?.contentType,
|
||||
MediaUrl: firstMedia?.path,
|
||||
MediaPaths:
|
||||
effectiveMedia && effectiveMedia.length > 0 ? effectiveMedia.map((m) => m.path) : undefined,
|
||||
@@ -614,7 +611,7 @@ export async function prepareSlackMessage(params: {
|
||||
effectiveMedia && effectiveMedia.length > 0 ? effectiveMedia.map((m) => m.path) : undefined,
|
||||
MediaTypes:
|
||||
effectiveMedia && effectiveMedia.length > 0
|
||||
? effectiveMedia.map((m) => m.contentType ?? "application/octet-stream")
|
||||
? effectiveMedia.map((m) => m.contentType ?? "")
|
||||
: undefined,
|
||||
CommandAuthorized: commandAuthorized,
|
||||
OriginatingChannel: "slack" as const,
|
||||
|
||||
Reference in New Issue
Block a user