Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions cmd/gateway.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ import (
"github.com/nextlevelbuilder/goclaw/internal/channels/discord"
"github.com/nextlevelbuilder/goclaw/internal/channels/facebook"
"github.com/nextlevelbuilder/goclaw/internal/channels/feishu"
"github.com/nextlevelbuilder/goclaw/internal/channels/mattermost"
"github.com/nextlevelbuilder/goclaw/internal/channels/pancake"
slackchannel "github.com/nextlevelbuilder/goclaw/internal/channels/slack"
"github.com/nextlevelbuilder/goclaw/internal/channels/telegram"
Expand Down Expand Up @@ -543,6 +544,7 @@ func runGateway() {
instanceLoader.RegisterFactory(channels.TypeSlack, slackchannel.FactoryWithPendingStore(pgStores.PendingMessages))
instanceLoader.RegisterFactory(channels.TypeFacebook, facebook.Factory)
instanceLoader.RegisterFactory(channels.TypePancake, pancake.Factory)
instanceLoader.RegisterFactory(channels.TypeMattermost, mattermost.FactoryWithStores(pgStores.Agents))
// Bitrix24: factory needs the portal store + encKey injected so each
// Channel can resolve its portal on Start(). The encKey here mirrors
// the one used by pg.NewPGStores → NewPGBitrixPortalStore.
Expand Down
11 changes: 11 additions & 0 deletions cmd/gateway_channels_setup.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import (
"github.com/nextlevelbuilder/goclaw/internal/channels"
"github.com/nextlevelbuilder/goclaw/internal/channels/discord"
"github.com/nextlevelbuilder/goclaw/internal/channels/feishu"
"github.com/nextlevelbuilder/goclaw/internal/channels/mattermost"
slackchannel "github.com/nextlevelbuilder/goclaw/internal/channels/slack"
"github.com/nextlevelbuilder/goclaw/internal/channels/telegram"
"github.com/nextlevelbuilder/goclaw/internal/channels/whatsapp"
Expand Down Expand Up @@ -142,6 +143,16 @@ func registerConfigChannels(cfg *config.Config, channelMgr *channels.Manager, ms
}
}
}

if cfg.Channels.Mattermost.Enabled && cfg.Channels.Mattermost.ServerURL != "" && cfg.Channels.Mattermost.BotToken != "" && instanceLoader == nil {
mm, err := mattermost.New(cfg.Channels.Mattermost, msgBus)
if err != nil {
slog.Error("failed to initialize mattermost channel", "error", err)
} else {
channelMgr.RegisterChannel(channels.TypeMattermost, mm)
slog.Info("mattermost channel enabled (config)")
}
}
}

// wireChannelRPCMethods registers WS RPC methods for channels, instances, agent links, and teams.
Expand Down
1 change: 1 addition & 0 deletions internal/channels/channel.go
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ const (
TypeWhatsApp = "whatsapp"
TypeZaloOA = "zalo_oa"
TypeZaloPersonal = "zalo_personal"
TypeMattermost = "mattermost"
)

// Channel defines the interface that all channel implementations must satisfy.
Expand Down
Loading