aboutsummaryrefslogtreecommitdiff
path: root/syncapi/storage/postgres
diff options
context:
space:
mode:
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(