feat: implement comprehensive loop prevention and architecture improvements

- Add comprehensive loop prevention at source level for all bridges:
  - XMPP bridge: Skip messages from own XMPP connection user
  - Mattermost bridge: Skip messages from bot user and remote users
- Remove cache from getOrCreateRemoteUser method for simplified user management
- Improve XMPP client architecture with direct handler delegation:
  - Add SetMessageHandler and GetJID methods to XMPP client
  - Move protocol normalization methods to client level
  - Implement handleIncomingXMPPMessage in XMPP bridge for business logic
- Fix message direction handling in XMPP message handler
- Add remote user invitation to shared channels via InviteRemoteToChannel API
- Clean up unused code and improve code formatting

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

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
Felipe M 2025-08-06 17:16:52 +02:00
parent 11a32afc53
commit d9c0215b93
No known key found for this signature in database
GPG key ID: 52E5D65FCF99808A
6 changed files with 63 additions and 44 deletions

View file

@ -161,6 +161,11 @@ func (c *Client) SetMessageHandler(handler mux.MessageHandlerFunc) {
c.messageHandler = handler
}
// GetJID returns the client's JID
func (c *Client) GetJID() jid.JID {
return c.jidAddr
}
// parseServerAddress parses a server URL and returns a host:port address
func (c *Client) parseServerAddress(serverURL string) (string, error) {
// Handle simple host:port format (e.g., "localhost:5222")