Skip to content

Commit

Permalink
add back in reasons/comments after schema tweak
Browse files Browse the repository at this point in the history
  • Loading branch information
bnewbold committed Nov 22, 2023
1 parent dfa6b6b commit 405721a
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
16 changes: 8 additions & 8 deletions automod/event.go
Original file line number Diff line number Diff line change
Expand Up @@ -78,13 +78,13 @@ func (e *RepoEvent) PersistAccountActions(ctx context.Context) error {
}
xrpcc := e.Engine.AdminClient
if len(e.AccountLabels) > 0 {
comment := "automod"
_, err := comatproto.AdminEmitModerationEvent(ctx, xrpcc, &comatproto.AdminEmitModerationEvent_Input{
CreatedBy: xrpcc.Auth.Did,
Event: &comatproto.AdminEmitModerationEvent_Input_Event{
AdminDefs_ModEventLabel: &comatproto.AdminDefs_ModEventLabel{
CreateLabelVals: dedupeStrings(e.AccountLabels),
// TODO: waiting for schema update
//Comment: "automod",
Comment: &comment,
},
},
Subject: &comatproto.AdminEmitModerationEvent_Input_Subject{
Expand Down Expand Up @@ -113,12 +113,12 @@ func (e *RepoEvent) PersistAccountActions(ctx context.Context) error {
}
}
if e.AccountTakedown {
comment := "automod"
_, err := comatproto.AdminEmitModerationEvent(ctx, xrpcc, &comatproto.AdminEmitModerationEvent_Input{
CreatedBy: xrpcc.Auth.Did,
Event: &comatproto.AdminEmitModerationEvent_Input_Event{
AdminDefs_ModEventTakedown: &comatproto.AdminDefs_ModEventTakedown{
// TODO: waiting for schema update
//Comment: "automod",
Comment: &comment,
},
},
Subject: &comatproto.AdminEmitModerationEvent_Input_Subject{
Expand Down Expand Up @@ -202,13 +202,13 @@ func (e *RecordEvent) PersistRecordActions(ctx context.Context) error {
}
xrpcc := e.Engine.AdminClient
if len(e.RecordLabels) > 0 {
comment := "automod"
_, err := comatproto.AdminEmitModerationEvent(ctx, xrpcc, &comatproto.AdminEmitModerationEvent_Input{
CreatedBy: xrpcc.Auth.Did,
Event: &comatproto.AdminEmitModerationEvent_Input_Event{
AdminDefs_ModEventLabel: &comatproto.AdminDefs_ModEventLabel{
CreateLabelVals: dedupeStrings(e.RecordLabels),
// TODO: waiting for schema update
//Comment: "automod",
Comment: &comment,
},
},
Subject: &comatproto.AdminEmitModerationEvent_Input_Subject{
Expand All @@ -233,12 +233,12 @@ func (e *RecordEvent) PersistRecordActions(ctx context.Context) error {
}
}
if e.RecordTakedown {
comment := "automod"
_, err := comatproto.AdminEmitModerationEvent(ctx, xrpcc, &comatproto.AdminEmitModerationEvent_Input{
CreatedBy: xrpcc.Auth.Did,
Event: &comatproto.AdminEmitModerationEvent_Input_Event{
AdminDefs_ModEventTakedown: &comatproto.AdminDefs_ModEventTakedown{
// TODO: waiting for schema update
//Comment: "automod",
Comment: &comment,
},
},
Subject: &comatproto.AdminEmitModerationEvent_Input_Subject{
Expand Down
6 changes: 3 additions & 3 deletions cmd/gosky/admin.go
Original file line number Diff line number Diff line change
Expand Up @@ -618,12 +618,12 @@ var takeDownAccountCmd = &cli.Command{
adminUser = resp
}

// TODO: reason can't be included under current schema, but may be possible soon
_ = reason
resp, err := atproto.AdminEmitModerationEvent(ctx, xrpcc, &atproto.AdminEmitModerationEvent_Input{
CreatedBy: adminUser,
Event: &atproto.AdminEmitModerationEvent_Input_Event{
AdminDefs_ModEventTakedown: &atproto.AdminDefs_ModEventTakedown{},
AdminDefs_ModEventTakedown: &atproto.AdminDefs_ModEventTakedown{
Comment: &reason,
},
},
Subject: &atproto.AdminEmitModerationEvent_Input_Subject{
AdminDefs_RepoRef: &atproto.AdminDefs_RepoRef{
Expand Down

0 comments on commit 405721a

Please sign in to comment.