mirror of
https://github.com/Unkn0wnCat/matrix-veles.git
synced 2025-06-03 19:22:00 +02:00
api: Fix Room query
This commit is contained in:
parent
cbd1aeb04a
commit
adf8bc3ee0
10 changed files with 800 additions and 105 deletions
|
@ -528,7 +528,7 @@ func ResolveComments(comments []*model2.DBComment, first *int, after *string) (*
|
|||
}, nil
|
||||
}
|
||||
|
||||
func buildDBRoomFilter(first *int, after *string, filter *model.RoomFilter /*, sort *model.UserSort*/, userId primitive.ObjectID) (*bson.M, *bson.M, *int64, error) {
|
||||
func buildDBRoomFilter(first *int, after *string, filter *model.RoomFilter /*, sort *model.UserSort*/, userMxids []string) (*bson.M, *bson.M, *int64, error) {
|
||||
compiledFilter := bson.M{}
|
||||
compiledSort := bson.M{}
|
||||
|
||||
|
@ -581,7 +581,9 @@ func buildDBRoomFilter(first *int, after *string, filter *model.RoomFilter /*, s
|
|||
}
|
||||
|
||||
if filter.CanEdit != nil && *filter.CanEdit == true {
|
||||
filterBsonW["admins"] = userId
|
||||
filterBsonW["admins"] = bson.M{
|
||||
"$in": userMxids,
|
||||
}
|
||||
}
|
||||
|
||||
filterBson = &filterBsonW
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue