aboutsummaryrefslogtreecommitdiff
path: root/clientapi
diff options
context:
space:
mode:
authordevonh <devon.dmytro@gmail.com>2023-09-26 17:44:49 +0000
committerGitHub <noreply@github.com>2023-09-26 17:44:49 +0000
commit16d922de701ca28966127b2e1160d65527f65e8e (patch)
tree4fc4c20ed936dbe7fc980905bfe91e43d5197aad /clientapi
parentd065219de1c2860c9cf28e8d8169fabfb71dcc31 (diff)
Complement fixes for pseudoIDs (#3206)
Diffstat (limited to 'clientapi')
-rw-r--r--clientapi/routing/sendevent.go9
1 files changed, 7 insertions, 2 deletions
diff --git a/clientapi/routing/sendevent.go b/clientapi/routing/sendevent.go
index fc9c05ba..69131966 100644
--- a/clientapi/routing/sendevent.go
+++ b/clientapi/routing/sendevent.go
@@ -263,7 +263,11 @@ func SendEvent(
}
func updatePowerLevels(req *http.Request, r map[string]interface{}, roomID string, rsAPI api.ClientRoomserverAPI) error {
- userMap := r["users"].(map[string]interface{})
+ users, ok := r["users"]
+ if !ok {
+ return nil
+ }
+ userMap := users.(map[string]interface{})
validRoomID, err := spec.NewRoomID(roomID)
if err != nil {
return err
@@ -277,7 +281,8 @@ func updatePowerLevels(req *http.Request, r map[string]interface{}, roomID strin
if err != nil {
return err
} else if senderID == nil {
- return fmt.Errorf("sender ID not found for %s in %s", uID, *validRoomID)
+ util.GetLogger(req.Context()).Warnf("sender ID not found for %s in %s", uID, *validRoomID)
+ continue
}
userMap[string(*senderID)] = level
delete(userMap, user)