aboutsummaryrefslogtreecommitdiff
path: root/syncapi/storage/postgres
diff options
context:
space:
mode:
authorNeil Alexander <neilalexander@users.noreply.github.com>2022-04-26 16:58:20 +0100
committerNeil Alexander <neilalexander@users.noreply.github.com>2022-04-26 16:58:20 +0100
commitb527e33c16d70ee6f94ac12c077b43283ff1fd86 (patch)
treeb638c155536a06149b0b4a130c673173e9a81d96 /syncapi/storage/postgres
parentf6d07768a82cdea07c56cf4ae463449292fa9fe4 (diff)
Send all account data on complete sync by default
Squashed commit of the following: commit 0ec8de57261d573a5f88577aa9d7a1174d3999b9 Author: Neil Alexander <neilalexander@users.noreply.github.com> Date: Tue Apr 26 16:56:30 2022 +0100 Select filter onto provided target filter commit da40b6fffbf5737864b223f49900048f557941f9 Author: Neil Alexander <neilalexander@users.noreply.github.com> Date: Tue Apr 26 16:48:00 2022 +0100 Specify other field too commit ffc0b0801f63bb4d3061b6813e3ce5f3b4c8fbcb Author: Neil Alexander <neilalexander@users.noreply.github.com> Date: Tue Apr 26 16:45:44 2022 +0100 Send as much account data as possible during complete sync
Diffstat (limited to 'syncapi/storage/postgres')
-rw-r--r--syncapi/storage/postgres/filter_table.go13
1 files changed, 6 insertions, 7 deletions
diff --git a/syncapi/storage/postgres/filter_table.go b/syncapi/storage/postgres/filter_table.go
index dfd3d696..c82ef092 100644
--- a/syncapi/storage/postgres/filter_table.go
+++ b/syncapi/storage/postgres/filter_table.go
@@ -73,21 +73,20 @@ func NewPostgresFilterTable(db *sql.DB) (tables.Filter, error) {
}
func (s *filterStatements) SelectFilter(
- ctx context.Context, localpart string, filterID string,
-) (*gomatrixserverlib.Filter, error) {
+ ctx context.Context, target *gomatrixserverlib.Filter, localpart string, filterID string,
+) error {
// Retrieve filter from database (stored as canonical JSON)
var filterData []byte
err := s.selectFilterStmt.QueryRowContext(ctx, localpart, filterID).Scan(&filterData)
if err != nil {
- return nil, err
+ return err
}
// Unmarshal JSON into Filter struct
- filter := gomatrixserverlib.DefaultFilter()
- if err = json.Unmarshal(filterData, &filter); err != nil {
- return nil, err
+ if err = json.Unmarshal(filterData, &target); err != nil {
+ return err
}
- return &filter, nil
+ return nil
}
func (s *filterStatements) InsertFilter(