refactor: standardize bridge-agnostic terminology and remove unused kvstore functions

- Replace "Room" with "Channel" in bridge-agnostic contexts throughout codebase
- Update BridgeRoomID → BridgeChannelID in model structs and all references
- Change error messages to use consistent "Channel" terminology for user-facing text
- Update log keys: bridge_room_id → bridge_channel_id for consistency
- Clean up kvstore constants file by removing unused functions and constants:
  - Removed BuildXMPPUserKey, BuildMattermostUserKey, BuildGhostUserKey
  - Removed BuildXMPPEventPostKey, BuildXMPPReactionKey functions
  - Removed unused constants: KeyPrefixXMPPUser, KeyPrefixMattermostUser, etc.
  - Keep only actively used BuildChannelMapKey and ExtractIdentifierFromChannelMapKey
- Preserve XMPP-specific "Room" terminology in appropriate contexts (client methods, JIDs)

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

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
Felipe M 2025-08-05 12:33:19 +02:00
parent eb852662f7
commit 4c6aeb2392
No known key found for this signature in database
GPG key ID: 52E5D65FCF99808A
8 changed files with 94 additions and 150 deletions

View file

@ -161,11 +161,11 @@ func (c *Handler) executeMapCommand(args *model.CommandArgs, fields []string) *m
// Create the mapping using BridgeManager
mappingReq := pluginModel.CreateChannelMappingRequest{
ChannelID: channelID,
BridgeName: "xmpp",
BridgeRoomID: roomJID,
UserID: args.UserId,
TeamID: args.TeamId,
ChannelID: channelID,
BridgeName: "xmpp",
BridgeChannelID: roomJID,
UserID: args.UserId,
TeamID: args.TeamId,
}
err = c.bridgeManager.CreateChannelMapping(mappingReq)
@ -292,7 +292,7 @@ func (c *Handler) formatMappingError(operation, roomJID string, err error) *mode
case strings.Contains(errorMsg, "already mapped to channel"):
return &model.CommandResponse{
ResponseType: model.CommandResponseTypeEphemeral,
Text: fmt.Sprintf(` **Room Already Mapped**
Text: fmt.Sprintf(` **Channel Already Mapped**
The XMPP room **%s** is already connected to another channel.
@ -305,7 +305,7 @@ The XMPP room **%s** is already connected to another channel.
case strings.Contains(errorMsg, "does not exist"):
return &model.CommandResponse{
ResponseType: model.CommandResponseTypeEphemeral,
Text: fmt.Sprintf(` **Room Not Found**
Text: fmt.Sprintf(` **Channel Not Found**
The XMPP room **%s** doesn't exist or isn't accessible.