diff --git a/cmd/recordcollector/main.go b/cmd/recordcollector/main.go index 9b4a157..816642f 100644 --- a/cmd/recordcollector/main.go +++ b/cmd/recordcollector/main.go @@ -36,11 +36,15 @@ var ignorePrefixes = []string{ } var labelPrefixes map[string]string +var nonExpiryPrefixes map[string]bool func init() { labelPrefixes = make(map[string]string) + nonExpiryPrefixes = make(map[string]bool) + for _, app := range pkg.Applications { labelPrefixes[app.NSID] = app.Label + nonExpiryPrefixes[app.Label] = app.NonExpiry } } @@ -204,15 +208,20 @@ func (h *handler) addLabel(ctx context.Context, did, label string) error { return nil } - var labelDuration int64 = 24 * 30 + eventLabel := toolsozone.ModerationDefs_ModEventLabel{ + CreateLabelVals: []string{label}, + NegateLabelVals: []string{}, + } + + if nonExpiry := nonExpiryPrefixes[label]; !nonExpiry { + var labelDuration int64 = 24 * 30 + eventLabel.DurationInHours = &labelDuration + } + input := &toolsozone.ModerationEmitEvent_Input{ CreatedBy: RecordCollectorDid, Event: &toolsozone.ModerationEmitEvent_Input_Event{ - ModerationDefs_ModEventLabel: &toolsozone.ModerationDefs_ModEventLabel{ - CreateLabelVals: []string{label}, - NegateLabelVals: []string{}, - DurationInHours: &labelDuration, - }, + ModerationDefs_ModEventLabel: &eventLabel, }, Subject: &toolsozone.ModerationEmitEvent_Input_Subject{ AdminDefs_RepoRef: &comatproto.AdminDefs_RepoRef{ diff --git a/pkg/apps.go b/pkg/apps.go index 27241a0..06788da 100644 --- a/pkg/apps.go +++ b/pkg/apps.go @@ -5,6 +5,7 @@ type Application struct { Description string NSID string Label string + NonExpiry bool } var Applications = []Application{ @@ -272,4 +273,11 @@ var Applications = []Application{ NSID: "dev.npmx", Label: "dev-npmx", }, + { + Name: "Germ", + Description: "End-to-end encrypted DMs right from your AT Protocol handle", + NSID: "com.germnetwork", + Label: "com-germnetwork", + NonExpiry: true, + }, }