Эх сурвалжийг харах

Skip key sharing IsInPortal check if user is admin

Tulir Asokan 4 жил өмнө
parent
commit
f88abe98bf
1 өөрчлөгдсөн 1 нэмэгдсэн , 1 устгасан
  1. 1 1
      crypto.go

+ 1 - 1
crypto.go

@@ -107,7 +107,7 @@ func (helper *CryptoHelper) allowKeyShare(device *crypto.DeviceIdentity, info ev
 			return &crypto.KeyShareRejection{Code: event.RoomKeyWithheldUnavailable, Reason: "Requested room is not a portal room"}
 		}
 		user := helper.bridge.GetUserByMXID(device.UserID)
-		if !user.IsInPortal(portal.Key) {
+		if !user.Admin && !user.IsInPortal(portal.Key) {
 			helper.log.Debugfln("Rejecting key request for %s from %s/%s: user is not in portal", info.SessionID, device.UserID, device.DeviceID)
 			return &crypto.KeyShareRejection{Code: event.RoomKeyWithheldUnauthorized, Reason: "You're not in that portal"}
 		}