this repo has no description
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

updates for QueryModerationEvents calls

+108 -101
+18 -17
automod/consumer/ozone.go
··· 55 55 period := time.Second * 5 56 56 57 57 for { 58 - //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) { 59 58 me, err := toolsozone.ModerationQueryEvents( 60 59 ctx, 61 60 oc.OzoneClient, 62 - nil, // addedLabels: If specified, only events where all of these labels were added are returned 63 - nil, // addedTags: If specified, only events where all of these tags were added are returned 64 - "", // comment: If specified, only events with comments containing the keyword are returned 65 - since.String(), // createdAfter: Retrieve events created after a given timestamp 66 - "", // createdBefore: Retrieve events created before a given timestamp 67 - "", // createdBy 68 - "", // cursor 69 - false, // hasComment: If true, only events with comments are returned 70 - true, // includeAllUserRecords: If true, events on all record types (posts, lists, profile etc.) owned by the did are returned 71 - limit, 72 - nil, // removedLabels: If specified, only events where all of these labels were removed are returned 73 - nil, // removedTags 74 - nil, // reportTypes 75 - "asc", // sortDirection: Sort direction for the events. Defaults to descending order of created at timestamp. 76 - "", // subject 77 - 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. 61 + nil, // addedLabels []string 62 + nil, // addedTags []string 63 + nil, // collections []string 64 + "", // comment string 65 + since.String(), // createdAfter string 66 + "", // createdBefore string 67 + "", // createdBy string 68 + "", // cursor string 69 + false, // hasComment bool 70 + true, // includeAllUserRecords bool 71 + limit, // limit int64 72 + nil, // removedLabels []string 73 + nil, // removedTags []string 74 + nil, // reportTypes []string 75 + "asc", // sortDirection string 76 + "", // subject string 77 + "", // subjectType string 78 + nil, // types []string 78 79 ) 79 80 if err != nil { 80 81 oc.Logger.Warn("ozone query events failed; sleeping then will retrying", "err", err, "period", period.String())
+36 -34
automod/engine/persisthelpers.go
··· 155 155 // before creating a report, query to see if automod has already reported this account in the past week for the same reason 156 156 // NOTE: this is running in an inner loop (if there are multiple reports), which is a bit inefficient, but seems acceptable 157 157 158 - // ModerationQueryEvents(ctx context.Context, c *xrpc.Client, createdBy string, cursor string, inc ludeAllUserRecords bool, limit int64, sortDirection string, subject string, types []string) 159 158 resp, err := toolsozone.ModerationQueryEvents( 160 159 ctx, 161 160 xrpcc, 162 - nil, 163 - nil, 164 - "", 165 - "", 166 - "", 167 - xrpcc.Auth.Did, 168 - "", 169 - false, 170 - false, 171 - 5, 172 - nil, 173 - nil, 174 - nil, 175 - "", 176 - did.String(), 177 - []string{"tools.ozone.moderation.defs#modEventReport"}, 161 + nil, // addedLabels []string 162 + nil, // addedTags []string 163 + nil, // collections []string 164 + "", // comment string 165 + "", // createdAfter string 166 + "", // createdBefore string 167 + xrpcc.Auth.Did, // createdBy string 168 + "", // cursor string 169 + false, // hasComment bool 170 + false, // includeAllUserRecords bool 171 + 5, // limit int64 172 + nil, // removedLabels []string 173 + nil, // removedTags []string 174 + nil, // reportTypes []string 175 + "", // sortDirection string 176 + did.String(), // subject string 177 + "", // subjectType string 178 + []string{"tools.ozone.moderation.defs#modEventReport"}, // types []string 178 179 ) 179 180 180 181 if err != nil { ··· 231 232 // before creating a report, query to see if automod has already reported this account in the past week for the same reason 232 233 // NOTE: this is running in an inner loop (if there are multiple reports), which is a bit inefficient, but seems acceptable 233 234 234 - // ModerationQueryEvents(ctx context.Context, c *xrpc.Client, createdBy string, cursor string, inc ludeAllUserRecords bool, limit int64, sortDirection string, subject string, types []string) 235 235 resp, err := toolsozone.ModerationQueryEvents( 236 236 ctx, 237 237 xrpcc, 238 - nil, 239 - nil, 240 - "", 241 - "", 242 - "", 243 - xrpcc.Auth.Did, 244 - "", 245 - false, 246 - false, 247 - 5, 248 - nil, 249 - nil, 250 - nil, 251 - "", 252 - uri.String(), 253 - []string{"tools.ozone.moderation.defs#modEventReport"}, 238 + nil, // addedLabels []string 239 + nil, // addedTags []string 240 + nil, // collections []string 241 + "", // comment string 242 + "", // createdAfter string 243 + "", // createdBefore string 244 + xrpcc.Auth.Did, // createdBy string 245 + "", // cursor string 246 + false, // hasComment bool 247 + false, // includeAllUserRecords bool 248 + 5, // limit int64 249 + nil, // removedLabels []string 250 + nil, // removedTags []string 251 + nil, // reportTypes []string 252 + "", // sortDirection string 253 + uri.String(), // subject string 254 + "", // subjectType string 255 + []string{"tools.ozone.moderation.defs#modEventReport"}, // types []string 254 256 ) 255 257 if err != nil { 256 258 return false, err
+18 -17
cmd/beemo/notify_reports.go
··· 68 68 xrpcc.Auth.RefreshJwt = refresh.RefreshJwt 69 69 70 70 // query just new reports (regardless of resolution state) 71 - // ModerationQueryEvents(ctx context.Context, c *xrpc.Client, createdBy string, cursor string, includeAllUserRecords bool, limit int64, sortDirection string, subject string, types []string) (*ModerationQueryEvents_Output, error) 72 71 var limit int64 = 50 73 72 me, err := toolsozone.ModerationQueryEvents( 74 73 cctx.Context, 75 74 xrpcc, 76 - nil, 77 - nil, 78 - "", 79 - "", 80 - "", 81 - "", 82 - "", 83 - false, 84 - true, 85 - limit, 86 - nil, 87 - nil, 88 - nil, 89 - "", 90 - "", 91 - []string{"tools.ozone.moderation.defs#modEventReport"}, 75 + nil, // addedLabels []string 76 + nil, // addedTags []string 77 + nil, // collections []string 78 + "", // comment string 79 + "", // createdAfter string 80 + "", // createdBefore string 81 + "", // createdBy string 82 + "", // cursor string 83 + false, // hasComment bool 84 + true, // includeAllUserRecords bool 85 + limit, // limit int64 86 + nil, // removedLabels []string 87 + nil, // removedTags []string 88 + nil, // reportTypes []string 89 + "", // sortDirection string 90 + "", // subject string 91 + "", // subjectType string 92 + []string{"tools.ozone.moderation.defs#modEventReport"}, // types []string 92 93 ) 93 94 if err != nil { 94 95 return err
+36 -33
cmd/gosky/admin.go
··· 389 389 xrpcc.AdminToken = &adminKey 390 390 391 391 // fetch recent moderation reports 392 - // AdminQueryModerationEvents(ctx context.Context, c *xrpc.Client, createdBy string, cursor string, includeAllUserRecords bool, limit int64, sortDirection string, subject string, types []string) (*AdminQueryModerationEvents_Output, error) 393 392 resp, err := toolsozone.ModerationQueryEvents( 394 393 ctx, 395 394 xrpcc, 396 - nil, 397 - nil, 398 - "", 399 - "", 400 - "", 401 - "", 402 - "", 403 - false, 404 - false, 405 - 100, 406 - nil, 407 - nil, 408 - nil, 409 - "", 410 - "", 411 - []string{"tools.ozone.moderation.defs#modEventReport"}, 395 + nil, // addedLabels []string 396 + nil, // addedTags []string 397 + nil, // collections []string 398 + "", // comment string 399 + "", // createdAfter string 400 + "", // createdBefore string 401 + "", // createdBy string 402 + "", // cursor string 403 + false, // hasComment bool 404 + false, // includeAllUserRecords bool 405 + 100, // limit int64 406 + nil, // removedLabels []string 407 + nil, // removedTags []string 408 + nil, // reportTypes []string 409 + "", // sortDirection string 410 + "", // subject string 411 + "", // subjectType string 412 + []string{"tools.ozone.moderation.defs#modEventReport"}, // types []string 412 413 ) 413 414 if err != nil { 414 415 return err ··· 705 706 resp, err := toolsozone.ModerationQueryEvents( 706 707 ctx, 707 708 xrpcc, 708 - nil, 709 - nil, 710 - "", 711 - "", 712 - "", 713 - "", 714 - "", 715 - false, 716 - false, 717 - 100, 718 - nil, 719 - nil, 720 - nil, 721 - "", 722 - "", 723 - []string{"tools.ozone.moderation.defs#modEventReport"}, 709 + nil, // addedLabels []string 710 + nil, // addedTags []string 711 + nil, // collections []string 712 + "", // comment string 713 + "", // createdAfter string 714 + "", // createdBefore string 715 + "", // createdBy string 716 + "", // cursor string 717 + false, // hasComment bool 718 + false, // includeAllUserRecords bool 719 + 100, // limit int64 720 + nil, // removedLabels []string 721 + nil, // removedTags []string 722 + nil, // reportTypes []string 723 + "", // sortDirection string 724 + "", // subject string 725 + "", // subjectType string 726 + []string{"tools.ozone.moderation.defs#modEventReport"}, // types []string 724 727 ) 725 728 if err != nil { 726 729 return err