diff --git a/library/api_store.go b/library/api_store.go index cd0983a6..2f14f9a8 100644 --- a/library/api_store.go +++ b/library/api_store.go @@ -14,7 +14,9 @@ import ( // "startTime": 1234, // optional, unix epoch time in nanoseconds // "endTime": 1234, // optional, unix epoch time in nanoseconds // "contentFilters": [ // optional -// "contentTopic1", ... +// { +// contentTopic: "contentTopic1" +// }, ... // ], // "pagingOptions": {// optional pagination information // "pageSize": 40, // number diff --git a/mobile/api_store.go b/mobile/api_store.go index 47999c85..18a5c7c1 100644 --- a/mobile/api_store.go +++ b/mobile/api_store.go @@ -22,7 +22,7 @@ type storePagingOptions struct { type storeMessagesArgs struct { Topic string `json:"pubsubTopic,omitempty"` - ContentFilters []string `json:"contentFilters,omitempty"` + ContentFilters []pb.ContentFilter `json:"contentFilters,omitempty"` StartTime int64 `json:"startTime,omitempty"` EndTime int64 `json:"endTime,omitempty"` PagingOptions storePagingOptions `json:"pagingOptions,omitempty"` @@ -73,11 +73,16 @@ func StoreQuery(queryJSON string, peerID string, ms int) string { ctx = context.Background() } + var contentTopics []string + for _, ct := range args.ContentFilters { + contentTopics = append(contentTopics, ct.ContentTopic) + } + res, err := wakuNode.Store().Query( ctx, store.Query{ Topic: args.Topic, - ContentTopics: args.ContentFilters, + ContentTopics: contentTopics, StartTime: args.StartTime, EndTime: args.EndTime, },