package channelbridge import ( "context" "fmt" "git.yeij.top/AskaEth/Cyrene_v2/internal/channel/adapter" ) // This file holds the outbound reply path (design/16 §4.6 §5): the loop's text is // delivered back to the source conversation through the same account adapter that // received the message. // sendReply delivers the loop's text back to the channel's source conversation // through the account adapter that received the message (multi-account safe, // design/16 §4.6 §5). It mirrors the inbound message's channel targeting fields so // the adapter resolves the same peer the message came from, and it exits through the // shared IM bubble dispatcher (strip role-play/narration +
split + 0.5-2s gap). func (b *Bridge) sendReply(ctx context.Context, in adapter.UnifiedMessage, a adapter.PlatformAdapter, text string) error { if a == nil { a = b.adapter(in.Platform) } if a == nil { return fmt.Errorf("channelbridge: no adapter for platform %q", in.Platform) } return b.sendIMBubbles(ctx, in, func(ctx context.Context, msg adapter.UnifiedMessage) error { return a.SendMessage(ctx, adapter.UnifiedResponse{Messages: []adapter.UnifiedMessage{msg}}) }, text) }