fix: properly send inbandregistration requests

This commit is contained in:
Felipe M 2025-08-12 18:43:21 +02:00
parent 4e4a290813
commit b99b412692
No known key found for this signature in database
GPG key ID: 52E5D65FCF99808A
3 changed files with 117 additions and 114 deletions

View file

@ -396,7 +396,10 @@ func (m *UserManager) cleanupGhostUser(mattermostUserID string) error {
}
// Unregister the ghost user account via XEP-0077
response, err := regHandler.CancelRegistration(ghostJIDParsed.Domain())
cancellationRequest := &xmppClient.CancellationRequest{
Username: ghostJIDParsed.Localpart(), // Extract username from ghost JID
}
response, err := regHandler.CancelRegistration(ghostJIDParsed.Domain(), cancellationRequest)
if err != nil {
return fmt.Errorf("failed to cancel registration for ghost user %s: %w", ghostData.GhostJID, err)
}