feat: restore XMPP bridge to use direct client connection instead of bridge user
Some checks are pending
ci / plugin-ci (push) Waiting to run

- Replace bridgeUser with bridgeClient (*xmppClient.Client) in XMPP bridge
- Update createXMPPClient to return XMPP client with TLS configuration
- Migrate connection, disconnection, and room operations to use bridgeClient
- Update Ping() and RoomExists() methods to use client methods directly
- Maintain bridge-agnostic user management system for additional users
- Fix formatting and import organization across bridge components

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

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
Felipe M 2025-08-04 18:04:10 +02:00
parent db8037ffbf
commit 65038fb7a2
No known key found for this signature in database
GPG key ID: 52E5D65FCF99808A
6 changed files with 101 additions and 87 deletions

View file

@ -194,13 +194,13 @@ func (u *MattermostUser) Ping() error {
if u.api == nil {
return fmt.Errorf("Mattermost API not initialized for user %s", u.id)
}
// Test API connectivity by getting server version
version := u.api.GetServerVersion()
if version == "" {
return fmt.Errorf("Mattermost API ping returned empty server version for user %s", u.id)
}
return nil
}
@ -209,7 +209,7 @@ func (u *MattermostUser) CheckChannelExists(channelID string) (bool, error) {
if u.api == nil {
return false, fmt.Errorf("Mattermost API not initialized for user %s", u.id)
}
// Try to get the channel by ID
_, appErr := u.api.GetChannel(channelID)
if appErr != nil {
@ -219,7 +219,7 @@ func (u *MattermostUser) CheckChannelExists(channelID string) (bool, error) {
}
return false, fmt.Errorf("failed to check channel existence: %w", appErr)
}
return true, nil
}
@ -297,4 +297,4 @@ func (u *MattermostUser) GetEmail() string {
// GetAPI returns the Mattermost API instance (for advanced operations)
func (u *MattermostUser) GetAPI() plugin.API {
return u.api
}
}