feat: refactor channel mapping with structured parameters and shared channel integration

- Add ChannelMappingRequest and ChannelMappingDeleteRequest structs with validation
- Update BridgeManager interface to accept structured parameters instead of individual strings
- Implement proper user ID and team ID propagation to shared channels
- Add shared channel creation/deletion integration with Mattermost API
- Update command handlers to provide user and team context
- Enhance logging with comprehensive parameter tracking

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
Felipe M 2025-08-01 19:10:40 +02:00
parent a5eb80817c
commit 1f45197aa8
No known key found for this signature in database
GPG key ID: 52E5D65FCF99808A
5 changed files with 223 additions and 51 deletions

View file

@ -152,7 +152,15 @@ func (c *Handler) executeMapCommand(args *model.CommandArgs, fields []string) *m
}
// Create the mapping using BridgeManager
err = c.bridgeManager.OnChannelMappingCreated(channelID, "xmpp", roomJID)
mappingReq := pluginModel.ChannelMappingRequest{
ChannelID: channelID,
BridgeName: "xmpp",
BridgeRoomID: roomJID,
UserID: args.UserId,
TeamID: args.TeamId,
}
err = c.bridgeManager.OnChannelMappingCreated(mappingReq)
if err != nil {
return &model.CommandResponse{
ResponseType: model.CommandResponseTypeEphemeral,
@ -195,7 +203,14 @@ func (c *Handler) executeUnmapCommand(args *model.CommandArgs) *model.CommandRes
}
// Delete the mapping
err = c.bridgeManager.OnChannelMappingDeleted(channelID, "xmpp")
deleteReq := pluginModel.ChannelMappingDeleteRequest{
ChannelID: channelID,
BridgeName: "xmpp",
UserID: args.UserId,
TeamID: args.TeamId,
}
err = c.bridgeManager.OnChannelMappingDeleted(deleteReq)
if err != nil {
return &model.CommandResponse{
ResponseType: model.CommandResponseTypeEphemeral,