From 1a4d898278ba4ca09af1579c57f57f0a24a7b43e Mon Sep 17 00:00:00 2001 From: Till Faelligen Date: Mon, 23 May 2022 08:02:34 +0200 Subject: [PATCH] Filter on m.room.message --- syncapi/routing/search.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/syncapi/routing/search.go b/syncapi/routing/search.go index 7b832e26a..04019d637 100644 --- a/syncapi/routing/search.go +++ b/syncapi/routing/search.go @@ -121,8 +121,12 @@ func Search(req *http.Request, device *api.Device, syncDB storage.Database, fts eventScore[hit.ID] = hit } + // Filter on m.room.message, as otherwise we also get events like m.reaction + // which "breaks" displaying results in Element Web. + types := []string{"m.room.message"} roomFilter := &gomatrixserverlib.RoomEventFilter{ Rooms: &rooms, + Types: &types, } evs, err := syncDB.Events(ctx, wantEvents)