aboutsummaryrefslogtreecommitdiff
path: root/matrix/sync.go
diff options
context:
space:
mode:
authorTulir Asokan <tulir@maunium.net>2018-03-24 13:27:13 +0200
committerTulir Asokan <tulir@maunium.net>2018-03-24 14:16:11 +0200
commit1321e1a06ac8d8db13014e9c94aa52e1ffa32c1a (patch)
tree81efb610c32cd343b916c91df68fb0d3c25aee51 /matrix/sync.go
parent38364646a73a5e666f2db6a34025e2a5a0e3999a (diff)
Possibly speed up syncs with filters
Diffstat (limited to 'matrix/sync.go')
-rw-r--r--matrix/sync.go21
1 files changed, 20 insertions, 1 deletions
diff --git a/matrix/sync.go b/matrix/sync.go
index a21d982..3e1a0c7 100644
--- a/matrix/sync.go
+++ b/matrix/sync.go
@@ -134,5 +134,24 @@ func (s *GomuksSyncer) OnFailedSync(res *gomatrix.RespSync, err error) (time.Dur
// GetFilterJSON returns a filter with a timeline limit of 50.
func (s *GomuksSyncer) GetFilterJSON(userID string) json.RawMessage {
- return json.RawMessage(`{"room":{"timeline":{"limit":50}}}`)
+ return json.RawMessage(`{
+ "room": {
+ "include_leave": true,
+ "state": {
+ "types": ["m.room.member"]
+ },
+ "timeline": {
+ "types": ["m.room.message"],
+ "limit": 50
+ },
+ "ephemeral": {
+ "types": ["m.typing"]
+ },
+ "account_data": {"types": []}
+ },
+ "account_data": {
+ "types": ["m.push_rules"]
+ },
+ "presence": {"types": []}
+ }`)
}