feat(federation): add fire-and-forget S2S typing relay

sendTypingRelay() mirrors sendCallRelay() — direct POST to peers,
no outbox, no retry. Uses federatedId for cross-instance channel
identification. Wired into handleDmTypingStart() for typing_start
and broadcastDmMessage() for typing_stop.
This commit is contained in:
Jannis Braun
2026-04-01 12:53:55 +02:00
parent b5fbc9d90e
commit b3011fb3da
3 changed files with 69 additions and 1 deletions
+4
View File
@@ -30,6 +30,7 @@ import {
getGroupDmTargetOrigins,
isFederationRelayEnabled,
computeFederatedId,
sendTypingRelay,
} from '../utils/federationOutbox.js';
import { getOurOrigin } from '../utils/federationAuth.js';
import type { FederationRelayEvent } from '@backspace/shared';
@@ -191,6 +192,9 @@ export function broadcastDmMessage(dmChannelId: string, message: DmMessageWithUs
}
}
// Relay typing stop to remote peers (fire-and-forget)
sendTypingRelay(dmChannelId, 'dm_typing_stop', message.userId);
for (const member of dmMembers) {
// If this member had closed the DM, resurface it first
if (member.closed === 1) {