1package visual
2
3import (
4 lexutil "github.com/bluesky-social/indigo/lex/util"
5)
6
7type AbyssScanResp struct {
8 Blob *lexutil.LexBlob `json:"blob"`
9 Match *AbyssMatchResult `json:"match,omitempty"`
10 Classify *AbyssClassifyResult `json:"classify,omitempty"`
11 Review *AbyssReviewState `json:"review,omitempty"`
12}
13
14type AbyssMatchResult struct {
15 Status string `json:"status"`
16 Hits []AbyssMatchHit `json:"hits"`
17}
18
19type AbyssMatchHit struct {
20 HashType string `json:"hashType,omitempty"`
21 HashValue string `json:"hashValue,omitempty"`
22 Label string `json:"label,omitempty"`
23 // TODO: Corpus
24}
25
26type AbyssClassifyResult struct {
27 // TODO
28}
29
30type AbyssReviewState struct {
31 State string `json:"state,omitempty"`
32 TicketID string `json:"ticketId,omitempty"`
33}
34
35func (amr *AbyssMatchResult) IsAbuseMatch() bool {
36 for _, hit := range amr.Hits {
37 if hit.Label == "csam" || hit.Label == "csem" {
38 return true
39 }
40 }
41 return false
42}