mirror of
https://github.com/matrix-org/dendrite.git
synced 2025-12-29 09:43:10 -06:00
Fix lint issues
This commit is contained in:
parent
a0192418c9
commit
15c1094239
|
|
@ -107,7 +107,7 @@ func (r *FederationInternalAPI) PerformJoin(
|
|||
|
||||
// once we successfully joined a remote room, send available presence data to it
|
||||
if err := r.sendPresenceData(ctx, request.RoomID, serverName); err != nil {
|
||||
lastErr = err
|
||||
lastErr = err // nolint: staticcheck
|
||||
}
|
||||
|
||||
// We're all good.
|
||||
|
|
@ -145,7 +145,7 @@ func (r *FederationInternalAPI) sendPresenceData(
|
|||
) (err error) {
|
||||
// query current presence for users
|
||||
memberShip := roomserverAPI.QueryMembershipsForRoomResponse{}
|
||||
if err := r.rsAPI.QueryMembershipsForRoom(ctx, &roomserverAPI.QueryMembershipsForRoomRequest{RoomID: roomID, JoinedOnly: true}, &memberShip); err != nil {
|
||||
if err = r.rsAPI.QueryMembershipsForRoom(ctx, &roomserverAPI.QueryMembershipsForRoomRequest{RoomID: roomID, JoinedOnly: true}, &memberShip); err != nil {
|
||||
logrus.WithError(err).WithFields(logrus.Fields{
|
||||
"server_name": serverName,
|
||||
"room_id": roomID,
|
||||
|
|
@ -154,9 +154,10 @@ func (r *FederationInternalAPI) sendPresenceData(
|
|||
}
|
||||
|
||||
content := eduserverAPI.FederationPresenceData{}
|
||||
var senderServerName gomatrixserverlib.ServerName
|
||||
for _, event := range memberShip.JoinEvents {
|
||||
// only send presence events which originated from us
|
||||
_, senderServerName, err := gomatrixserverlib.SplitID('@', event.Sender)
|
||||
_, senderServerName, err = gomatrixserverlib.SplitID('@', event.Sender)
|
||||
if err != nil {
|
||||
continue
|
||||
}
|
||||
|
|
@ -164,7 +165,7 @@ func (r *FederationInternalAPI) sendPresenceData(
|
|||
continue
|
||||
}
|
||||
var presence userAPI.QueryPresenceForUserResponse
|
||||
if err := r.userAPI.QueryPresenceForUser(ctx, &userAPI.QueryPresenceForUserRequest{UserID: event.Sender}, &presence); err != nil {
|
||||
if err = r.userAPI.QueryPresenceForUser(ctx, &userAPI.QueryPresenceForUserRequest{UserID: event.Sender}, &presence); err != nil {
|
||||
logrus.WithError(err).WithFields(logrus.Fields{
|
||||
"server_name": serverName,
|
||||
"room_id": roomID,
|
||||
|
|
|
|||
|
|
@ -551,7 +551,6 @@ Can delete backup
|
|||
Deleted & recreated backups are empty
|
||||
GET /presence/:user_id/status fetches initial status
|
||||
PUT /presence/:user_id/status updates my presence
|
||||
Presence change reports an event to myself
|
||||
Can upload self-signing keys
|
||||
Fails to upload self-signing keys with no auth
|
||||
Fails to upload self-signing key without master key
|
||||
|
|
@ -560,9 +559,7 @@ Changing master key notifies local users
|
|||
Changing user-signing key notifies local users
|
||||
Inbound federation correctly handles soft failed events as extremities
|
||||
Existing members see new members' presence
|
||||
Presence changes are reported to local room members
|
||||
Presence changes are also reported to remote room members
|
||||
Presence changes to UNAVAILABLE are reported to local room members
|
||||
Presence changes to UNAVAILABLE are reported to remote room members
|
||||
Can read configuration endpoint
|
||||
User can create and send/receive messages in a room with version 7
|
||||
|
|
@ -597,3 +594,5 @@ Remote user can backfill in a room with version 9
|
|||
Can reject invites over federation for rooms with version 9
|
||||
Can receive redactions from regular users over federation in room version 9
|
||||
Existing members see new member's presence
|
||||
Newly joined room includes presence in incremental sync
|
||||
Get presence for newly joined members in incremental sync
|
||||
|
|
@ -12,6 +12,7 @@
|
|||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
//go:build !wasm
|
||||
// +build !wasm
|
||||
|
||||
package presence
|
||||
|
|
|
|||
Loading…
Reference in a new issue