···5555 period := time.Second * 5
56565757 for {
5858- //func ModerationQueryEvents(ctx context.Context, c *xrpc.Client, addedLabels []string, addedTags []string, comment string, createdAfter string, createdBefore string, createdBy string, cursor string, hasComment bool, includeAllUserRecords bool, limit int64, removedLabels []string, removedTags []string, reportTypes []string, sortDirection string, subject string, types []string) (*ModerationQueryEvents_Output, error) {
5958 me, err := toolsozone.ModerationQueryEvents(
6059 ctx,
6160 oc.OzoneClient,
6262- nil, // addedLabels: If specified, only events where all of these labels were added are returned
6363- nil, // addedTags: If specified, only events where all of these tags were added are returned
6464- "", // comment: If specified, only events with comments containing the keyword are returned
6565- since.String(), // createdAfter: Retrieve events created after a given timestamp
6666- "", // createdBefore: Retrieve events created before a given timestamp
6767- "", // createdBy
6868- "", // cursor
6969- false, // hasComment: If true, only events with comments are returned
7070- true, // includeAllUserRecords: If true, events on all record types (posts, lists, profile etc.) owned by the did are returned
7171- limit,
7272- nil, // removedLabels: If specified, only events where all of these labels were removed are returned
7373- nil, // removedTags
7474- nil, // reportTypes
7575- "asc", // sortDirection: Sort direction for the events. Defaults to descending order of created at timestamp.
7676- "", // subject
7777- nil, // types: The types of events (fully qualified string in the format of tools.ozone.moderation.defs#modEvent<name>) to filter by. If not specified, all events are returned.
6161+ nil, // addedLabels []string
6262+ nil, // addedTags []string
6363+ nil, // collections []string
6464+ "", // comment string
6565+ since.String(), // createdAfter string
6666+ "", // createdBefore string
6767+ "", // createdBy string
6868+ "", // cursor string
6969+ false, // hasComment bool
7070+ true, // includeAllUserRecords bool
7171+ limit, // limit int64
7272+ nil, // removedLabels []string
7373+ nil, // removedTags []string
7474+ nil, // reportTypes []string
7575+ "asc", // sortDirection string
7676+ "", // subject string
7777+ "", // subjectType string
7878+ nil, // types []string
7879 )
7980 if err != nil {
8081 oc.Logger.Warn("ozone query events failed; sleeping then will retrying", "err", err, "period", period.String())
+36-34
automod/engine/persisthelpers.go
···155155 // before creating a report, query to see if automod has already reported this account in the past week for the same reason
156156 // NOTE: this is running in an inner loop (if there are multiple reports), which is a bit inefficient, but seems acceptable
157157158158- // ModerationQueryEvents(ctx context.Context, c *xrpc.Client, createdBy string, cursor string, inc ludeAllUserRecords bool, limit int64, sortDirection string, subject string, types []string)
159158 resp, err := toolsozone.ModerationQueryEvents(
160159 ctx,
161160 xrpcc,
162162- nil,
163163- nil,
164164- "",
165165- "",
166166- "",
167167- xrpcc.Auth.Did,
168168- "",
169169- false,
170170- false,
171171- 5,
172172- nil,
173173- nil,
174174- nil,
175175- "",
176176- did.String(),
177177- []string{"tools.ozone.moderation.defs#modEventReport"},
161161+ nil, // addedLabels []string
162162+ nil, // addedTags []string
163163+ nil, // collections []string
164164+ "", // comment string
165165+ "", // createdAfter string
166166+ "", // createdBefore string
167167+ xrpcc.Auth.Did, // createdBy string
168168+ "", // cursor string
169169+ false, // hasComment bool
170170+ false, // includeAllUserRecords bool
171171+ 5, // limit int64
172172+ nil, // removedLabels []string
173173+ nil, // removedTags []string
174174+ nil, // reportTypes []string
175175+ "", // sortDirection string
176176+ did.String(), // subject string
177177+ "", // subjectType string
178178+ []string{"tools.ozone.moderation.defs#modEventReport"}, // types []string
178179 )
179180180181 if err != nil {
···231232 // before creating a report, query to see if automod has already reported this account in the past week for the same reason
232233 // NOTE: this is running in an inner loop (if there are multiple reports), which is a bit inefficient, but seems acceptable
233234234234- // ModerationQueryEvents(ctx context.Context, c *xrpc.Client, createdBy string, cursor string, inc ludeAllUserRecords bool, limit int64, sortDirection string, subject string, types []string)
235235 resp, err := toolsozone.ModerationQueryEvents(
236236 ctx,
237237 xrpcc,
238238- nil,
239239- nil,
240240- "",
241241- "",
242242- "",
243243- xrpcc.Auth.Did,
244244- "",
245245- false,
246246- false,
247247- 5,
248248- nil,
249249- nil,
250250- nil,
251251- "",
252252- uri.String(),
253253- []string{"tools.ozone.moderation.defs#modEventReport"},
238238+ nil, // addedLabels []string
239239+ nil, // addedTags []string
240240+ nil, // collections []string
241241+ "", // comment string
242242+ "", // createdAfter string
243243+ "", // createdBefore string
244244+ xrpcc.Auth.Did, // createdBy string
245245+ "", // cursor string
246246+ false, // hasComment bool
247247+ false, // includeAllUserRecords bool
248248+ 5, // limit int64
249249+ nil, // removedLabels []string
250250+ nil, // removedTags []string
251251+ nil, // reportTypes []string
252252+ "", // sortDirection string
253253+ uri.String(), // subject string
254254+ "", // subjectType string
255255+ []string{"tools.ozone.moderation.defs#modEventReport"}, // types []string
254256 )
255257 if err != nil {
256258 return false, err