mirror of
https://github.com/logos-messaging/logos-messaging-go.git
synced 2026-01-08 17:03:09 +00:00
fix: store content filters
This commit is contained in:
parent
0525b1cbc7
commit
f8d7572548
@ -14,7 +14,9 @@ import (
|
|||||||
// "startTime": 1234, // optional, unix epoch time in nanoseconds
|
// "startTime": 1234, // optional, unix epoch time in nanoseconds
|
||||||
// "endTime": 1234, // optional, unix epoch time in nanoseconds
|
// "endTime": 1234, // optional, unix epoch time in nanoseconds
|
||||||
// "contentFilters": [ // optional
|
// "contentFilters": [ // optional
|
||||||
// "contentTopic1", ...
|
// {
|
||||||
|
// contentTopic: "contentTopic1"
|
||||||
|
// }, ...
|
||||||
// ],
|
// ],
|
||||||
// "pagingOptions": {// optional pagination information
|
// "pagingOptions": {// optional pagination information
|
||||||
// "pageSize": 40, // number
|
// "pageSize": 40, // number
|
||||||
|
|||||||
@ -22,7 +22,7 @@ type storePagingOptions struct {
|
|||||||
|
|
||||||
type storeMessagesArgs struct {
|
type storeMessagesArgs struct {
|
||||||
Topic string `json:"pubsubTopic,omitempty"`
|
Topic string `json:"pubsubTopic,omitempty"`
|
||||||
ContentFilters []string `json:"contentFilters,omitempty"`
|
ContentFilters []pb.ContentFilter `json:"contentFilters,omitempty"`
|
||||||
StartTime int64 `json:"startTime,omitempty"`
|
StartTime int64 `json:"startTime,omitempty"`
|
||||||
EndTime int64 `json:"endTime,omitempty"`
|
EndTime int64 `json:"endTime,omitempty"`
|
||||||
PagingOptions storePagingOptions `json:"pagingOptions,omitempty"`
|
PagingOptions storePagingOptions `json:"pagingOptions,omitempty"`
|
||||||
@ -73,11 +73,16 @@ func StoreQuery(queryJSON string, peerID string, ms int) string {
|
|||||||
ctx = context.Background()
|
ctx = context.Background()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var contentTopics []string
|
||||||
|
for _, ct := range args.ContentFilters {
|
||||||
|
contentTopics = append(contentTopics, ct.ContentTopic)
|
||||||
|
}
|
||||||
|
|
||||||
res, err := wakuNode.Store().Query(
|
res, err := wakuNode.Store().Query(
|
||||||
ctx,
|
ctx,
|
||||||
store.Query{
|
store.Query{
|
||||||
Topic: args.Topic,
|
Topic: args.Topic,
|
||||||
ContentTopics: args.ContentFilters,
|
ContentTopics: contentTopics,
|
||||||
StartTime: args.StartTime,
|
StartTime: args.StartTime,
|
||||||
EndTime: args.EndTime,
|
EndTime: args.EndTime,
|
||||||
},
|
},
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user