feat: restore XMPP bridge to use direct client connection instead of bridge user
Some checks are pending
ci / plugin-ci (push) Waiting to run
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:
parent
db8037ffbf
commit
65038fb7a2
6 changed files with 101 additions and 87 deletions
|
@ -178,7 +178,7 @@ func testXMPPClient(config *Config) error {
|
|||
var mucDuration time.Duration
|
||||
var dmDuration time.Duration
|
||||
var roomExistsDuration time.Duration
|
||||
|
||||
|
||||
// Test MUC operations if requested
|
||||
if config.TestMUC {
|
||||
start = time.Now()
|
||||
|
@ -286,7 +286,7 @@ func testMUCOperations(client *xmpp.Client, config *Config) error {
|
|||
return fmt.Errorf("failed to join MUC room %s: %w", config.TestRoom, err)
|
||||
}
|
||||
joinDuration := time.Since(start)
|
||||
|
||||
|
||||
var sendDuration time.Duration
|
||||
|
||||
if config.Verbose {
|
||||
|
@ -300,7 +300,7 @@ func testMUCOperations(client *xmpp.Client, config *Config) error {
|
|||
RoomJID: config.TestRoom,
|
||||
Message: testMessage,
|
||||
}
|
||||
|
||||
|
||||
start = time.Now()
|
||||
_, err = client.SendMessage(messageReq)
|
||||
if err != nil {
|
||||
|
@ -352,7 +352,7 @@ func testDirectMessage(client *xmpp.Client, config *Config) error {
|
|||
// Send a test message to the admin user
|
||||
testMessage := fmt.Sprintf("Test direct message from XMPP doctor at %s", time.Now().Format("15:04:05"))
|
||||
adminJID := "admin@localhost" // Default admin user for development server
|
||||
|
||||
|
||||
start := time.Now()
|
||||
err := client.SendDirectMessage(adminJID, testMessage)
|
||||
if err != nil {
|
||||
|
@ -447,4 +447,4 @@ func (l *SimpleLogger) LogWarn(msg string, args ...interface{}) {
|
|||
// LogError logs error messages
|
||||
func (l *SimpleLogger) LogError(msg string, args ...interface{}) {
|
||||
log.Printf("[ERROR] "+msg, args...)
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue