Return correct error message when sending server notices (#3594)

Fixes #3502

### Pull Request Checklist

<!-- Please read
https://matrix-org.github.io/dendrite/development/contributing before
submitting your pull request -->

* [x] I have added Go unit tests or [Complement integration
tests](https://github.com/matrix-org/complement) for this PR _or_ I have
justified why this PR doesn't need tests
* [x] Pull request includes a [sign off
below](https://element-hq.github.io/dendrite/development/contributing#sign-off)
_or_ I have already signed off privately

Signed-off-by: Till Faelligen <2353100+S7evinK@users.noreply.github.com>
This commit is contained in:
Till 2025-06-05 21:07:37 +02:00 committed by GitHub
parent 0ca63e0650
commit 518697fd87
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -100,7 +100,7 @@ func SendServerNotice(
for _, membership := range []string{"join", "invite", "leave"} {
userRooms, queryErr := rsAPI.QueryRoomsForUser(ctx, *userID, membership)
if queryErr != nil {
return util.ErrorResponse(err)
return util.ErrorResponse(queryErr)
}
allUserRooms = append(allUserRooms, userRooms...)
}