mirror of
https://github.com/memohai/Memoh.git
synced 2026-04-27 07:16:19 +09:00
chore: remove @memohai/cli
This commit is contained in:
@@ -8,7 +8,7 @@ import (
|
||||
|
||||
// RouteHubBroadcaster implements channel.StreamObserver by forwarding events
|
||||
// to the RouteHub. This enables cross-channel visibility: events from external
|
||||
// channels (Telegram, Feishu, …) are mirrored to WebUI/CLI subscribers.
|
||||
// channels (Telegram, Feishu, …) are mirrored to RouteHub subscribers.
|
||||
type RouteHubBroadcaster struct {
|
||||
hub *RouteHub
|
||||
}
|
||||
|
||||
@@ -484,7 +484,7 @@ func (p *ChannelInboundProcessor) HandleInbound(ctx context.Context, cfg channel
|
||||
}()
|
||||
|
||||
// For non-local channels, wrap the stream so events are mirrored to the
|
||||
// RouteHub (and thus to WebUI/CLI subscribers).
|
||||
// RouteHub (and thus to Web UI and other local subscribers).
|
||||
if p.observer != nil && !isLocalChannelType(msg.Channel) {
|
||||
stream = channel.NewTeeStream(stream, p.observer, strings.TrimSpace(identity.BotID), msg.Channel)
|
||||
// Broadcast the inbound user message so WebUI can display it.
|
||||
@@ -1852,7 +1852,7 @@ func extractStorageKey(accessPath string, _ string) string {
|
||||
}
|
||||
|
||||
// isLocalChannelType returns true for channels that already publish to RouteHub
|
||||
// natively (Web, CLI). Wrapping these with a tee would cause duplicate events.
|
||||
// natively (e.g. web, cli). Wrapping these with a tee would cause duplicate events.
|
||||
func isLocalChannelType(ct channel.ChannelType) bool {
|
||||
s := strings.ToLower(strings.TrimSpace(string(ct)))
|
||||
return s == "web" || s == "cli"
|
||||
|
||||
Reference in New Issue
Block a user