@atproto/api 0.5.2 → 0.5.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/definitions/post-moderation-behaviors.json +134 -2
- package/dist/index.js +18 -14
- package/dist/index.js.map +2 -2
- package/dist/moderation/util.d.ts +1 -3
- package/docs/moderation-behaviors/posts.md +332 -2
- package/package.json +1 -1
- package/src/moderation/index.ts +9 -9
- package/src/moderation/util.ts +9 -5
- package/tsconfig.build.tsbuildinfo +1 -1
|
@@ -676,7 +676,7 @@
|
|
|
676
676
|
"author": "self",
|
|
677
677
|
"labels": {"post": ["!hide"]},
|
|
678
678
|
"behaviors": {
|
|
679
|
-
"content": {"cause": "label:!hide", "
|
|
679
|
+
"content": {"cause": "label:!hide", "blur": true}
|
|
680
680
|
}
|
|
681
681
|
},
|
|
682
682
|
"Self-post: Imperative label ('!hide') on author profile": {
|
|
@@ -700,7 +700,7 @@
|
|
|
700
700
|
"quoteAuthor": "self",
|
|
701
701
|
"labels": {"quotedPost": ["!hide"]},
|
|
702
702
|
"behaviors": {
|
|
703
|
-
"embed": {"cause": "label:!hide", "
|
|
703
|
+
"embed": {"cause": "label:!hide", "blur": true}
|
|
704
704
|
}
|
|
705
705
|
},
|
|
706
706
|
"Self-post: Imperative label ('!hide') on quoted author account": {
|
|
@@ -712,6 +712,138 @@
|
|
|
712
712
|
"behaviors": {}
|
|
713
713
|
},
|
|
714
714
|
|
|
715
|
+
"Self-post: Imperative label ('!warn') on post": {
|
|
716
|
+
"cfg": "none",
|
|
717
|
+
"subject": "post",
|
|
718
|
+
"author": "self",
|
|
719
|
+
"labels": {"post": ["!warn"]},
|
|
720
|
+
"behaviors": {
|
|
721
|
+
"content": {"cause": "label:!warn", "blur": true}
|
|
722
|
+
}
|
|
723
|
+
},
|
|
724
|
+
"Self-post: Imperative label ('!warn') on author profile": {
|
|
725
|
+
"cfg": "none",
|
|
726
|
+
"subject": "post",
|
|
727
|
+
"author": "self",
|
|
728
|
+
"labels": {"profile": ["!warn"]},
|
|
729
|
+
"behaviors": {}
|
|
730
|
+
},
|
|
731
|
+
"Self-post: Imperative label ('!warn') on author account": {
|
|
732
|
+
"cfg": "none",
|
|
733
|
+
"subject": "post",
|
|
734
|
+
"author": "self",
|
|
735
|
+
"labels": {"account": ["!warn"]},
|
|
736
|
+
"behaviors": {}
|
|
737
|
+
},
|
|
738
|
+
"Self-post: Imperative label ('!warn') on quoted post": {
|
|
739
|
+
"cfg": "none",
|
|
740
|
+
"subject": "post",
|
|
741
|
+
"author": "self",
|
|
742
|
+
"quoteAuthor": "self",
|
|
743
|
+
"labels": {"quotedPost": ["!warn"]},
|
|
744
|
+
"behaviors": {
|
|
745
|
+
"embed": {"cause": "label:!warn", "blur": true}
|
|
746
|
+
}
|
|
747
|
+
},
|
|
748
|
+
"Self-post: Imperative label ('!warn') on quoted author account": {
|
|
749
|
+
"cfg": "none",
|
|
750
|
+
"subject": "post",
|
|
751
|
+
"author": "self",
|
|
752
|
+
"quoteAuthor": "self",
|
|
753
|
+
"labels": {"quotedAccount": ["!warn"]},
|
|
754
|
+
"behaviors": {}
|
|
755
|
+
},
|
|
756
|
+
|
|
757
|
+
"Self-post: Blur-media label ('porn') on post (hide)": {
|
|
758
|
+
"cfg": "porn-hide",
|
|
759
|
+
"subject": "post",
|
|
760
|
+
"author": "self",
|
|
761
|
+
"labels": {"post": ["porn"]},
|
|
762
|
+
"behaviors": {
|
|
763
|
+
"embed": {"cause": "label:porn", "blur": true}
|
|
764
|
+
}
|
|
765
|
+
},
|
|
766
|
+
"Self-post: Blur-media label ('porn') on author profile (hide)": {
|
|
767
|
+
"cfg": "porn-hide",
|
|
768
|
+
"subject": "post",
|
|
769
|
+
"author": "self",
|
|
770
|
+
"labels": {"profile": ["porn"]},
|
|
771
|
+
"behaviors": {
|
|
772
|
+
}
|
|
773
|
+
},
|
|
774
|
+
"Self-post: Blur-media label ('porn') on author account (hide)": {
|
|
775
|
+
"cfg": "porn-hide",
|
|
776
|
+
"subject": "post",
|
|
777
|
+
"author": "self",
|
|
778
|
+
"labels": {"account": ["porn"]},
|
|
779
|
+
"behaviors": {
|
|
780
|
+
}
|
|
781
|
+
},
|
|
782
|
+
"Self-post: Blur-media label ('porn') on quoted post (hide)": {
|
|
783
|
+
"cfg": "porn-hide",
|
|
784
|
+
"subject": "post",
|
|
785
|
+
"author": "self",
|
|
786
|
+
"quoteAuthor": "self",
|
|
787
|
+
"labels": {"quotedPost": ["porn"]},
|
|
788
|
+
"behaviors": {
|
|
789
|
+
"embed": {"cause": "label:porn", "blur": true}
|
|
790
|
+
}
|
|
791
|
+
},
|
|
792
|
+
"Self-post: Blur-media label ('porn') on quoted author account (hide)": {
|
|
793
|
+
"cfg": "porn-hide",
|
|
794
|
+
"subject": "post",
|
|
795
|
+
"author": "self",
|
|
796
|
+
"quoteAuthor": "self",
|
|
797
|
+
"labels": {"quotedAccount": ["porn"]},
|
|
798
|
+
"behaviors": {
|
|
799
|
+
}
|
|
800
|
+
},
|
|
801
|
+
|
|
802
|
+
"Self-post: Blur-media label ('porn') on post (warn)": {
|
|
803
|
+
"cfg": "porn-warn",
|
|
804
|
+
"subject": "post",
|
|
805
|
+
"author": "self",
|
|
806
|
+
"labels": {"post": ["porn"]},
|
|
807
|
+
"behaviors": {
|
|
808
|
+
"embed": {"cause": "label:porn", "blur": true}
|
|
809
|
+
}
|
|
810
|
+
},
|
|
811
|
+
"Self-post: Blur-media label ('porn') on author profile (warn)": {
|
|
812
|
+
"cfg": "porn-warn",
|
|
813
|
+
"subject": "post",
|
|
814
|
+
"author": "self",
|
|
815
|
+
"labels": {"profile": ["porn"]},
|
|
816
|
+
"behaviors": {
|
|
817
|
+
}
|
|
818
|
+
},
|
|
819
|
+
"Self-post: Blur-media label ('porn') on author account (warn)": {
|
|
820
|
+
"cfg": "porn-warn",
|
|
821
|
+
"subject": "post",
|
|
822
|
+
"author": "self",
|
|
823
|
+
"labels": {"account": ["porn"]},
|
|
824
|
+
"behaviors": {
|
|
825
|
+
}
|
|
826
|
+
},
|
|
827
|
+
"Self-post: Blur-media label ('porn') on quoted post (warn)": {
|
|
828
|
+
"cfg": "porn-warn",
|
|
829
|
+
"subject": "post",
|
|
830
|
+
"author": "self",
|
|
831
|
+
"quoteAuthor": "self",
|
|
832
|
+
"labels": {"quotedPost": ["porn"]},
|
|
833
|
+
"behaviors": {
|
|
834
|
+
"embed": {"cause": "label:porn", "blur": true}
|
|
835
|
+
}
|
|
836
|
+
},
|
|
837
|
+
"Self-post: Blur-media label ('porn') on quoted author account (warn)": {
|
|
838
|
+
"cfg": "porn-warn",
|
|
839
|
+
"subject": "post",
|
|
840
|
+
"author": "self",
|
|
841
|
+
"quoteAuthor": "self",
|
|
842
|
+
"labels": {"quotedAccount": ["porn"]},
|
|
843
|
+
"behaviors": {
|
|
844
|
+
}
|
|
845
|
+
},
|
|
846
|
+
|
|
715
847
|
"Post with blocked author": {
|
|
716
848
|
"cfg": "none",
|
|
717
849
|
"subject": "post",
|
package/dist/index.js
CHANGED
|
@@ -28358,14 +28358,18 @@ function takeHighestPriorityDecision(...decisions) {
|
|
|
28358
28358
|
});
|
|
28359
28359
|
return filtered[0];
|
|
28360
28360
|
}
|
|
28361
|
-
function downgradeDecision(decision,
|
|
28362
|
-
decision.blur = false;
|
|
28363
|
-
decision.blurMedia = false;
|
|
28361
|
+
function downgradeDecision(decision, to) {
|
|
28364
28362
|
decision.filter = false;
|
|
28365
28363
|
decision.noOverride = false;
|
|
28366
|
-
|
|
28367
|
-
|
|
28364
|
+
if (to === "noop") {
|
|
28365
|
+
decision.blur = false;
|
|
28366
|
+
decision.blurMedia = false;
|
|
28367
|
+
decision.alert = false;
|
|
28368
28368
|
delete decision.cause;
|
|
28369
|
+
} else if (to === "alert") {
|
|
28370
|
+
decision.blur = false;
|
|
28371
|
+
decision.blurMedia = false;
|
|
28372
|
+
decision.alert = true;
|
|
28369
28373
|
}
|
|
28370
28374
|
}
|
|
28371
28375
|
function isModerationDecisionNoop(decision, { ignoreFilter } = { ignoreFilter: false }) {
|
|
@@ -28412,10 +28416,10 @@ function moderateProfile(subject, opts) {
|
|
|
28412
28416
|
}
|
|
28413
28417
|
profile.filter = false;
|
|
28414
28418
|
if (!isModerationDecisionNoop(account) && account.did === opts.userDid) {
|
|
28415
|
-
downgradeDecision(account,
|
|
28419
|
+
downgradeDecision(account, "alert");
|
|
28416
28420
|
}
|
|
28417
28421
|
if (!isModerationDecisionNoop(profile) && profile.did === opts.userDid) {
|
|
28418
|
-
downgradeDecision(profile,
|
|
28422
|
+
downgradeDecision(profile, "alert");
|
|
28419
28423
|
}
|
|
28420
28424
|
let avatarBlur = false;
|
|
28421
28425
|
let avatarNoOverride = false;
|
|
@@ -28458,19 +28462,19 @@ function moderatePost(subject, opts) {
|
|
|
28458
28462
|
quote.blur = true;
|
|
28459
28463
|
}
|
|
28460
28464
|
if (!isModerationDecisionNoop(post) && post.did === opts.userDid) {
|
|
28461
|
-
downgradeDecision(post,
|
|
28465
|
+
downgradeDecision(post, "blur");
|
|
28462
28466
|
}
|
|
28463
|
-
if (
|
|
28464
|
-
downgradeDecision(account,
|
|
28467
|
+
if (account.cause && account.did === opts.userDid) {
|
|
28468
|
+
downgradeDecision(account, "noop");
|
|
28465
28469
|
}
|
|
28466
|
-
if (
|
|
28467
|
-
downgradeDecision(profile,
|
|
28470
|
+
if (profile.cause && profile.did === opts.userDid) {
|
|
28471
|
+
downgradeDecision(profile, "noop");
|
|
28468
28472
|
}
|
|
28469
28473
|
if (quote && !isModerationDecisionNoop(quote) && quote.did === opts.userDid) {
|
|
28470
|
-
downgradeDecision(quote,
|
|
28474
|
+
downgradeDecision(quote, "blur");
|
|
28471
28475
|
}
|
|
28472
28476
|
if (quotedAccount && !isModerationDecisionNoop(quotedAccount) && quotedAccount.did === opts.userDid) {
|
|
28473
|
-
downgradeDecision(quotedAccount,
|
|
28477
|
+
downgradeDecision(quotedAccount, "noop");
|
|
28474
28478
|
}
|
|
28475
28479
|
const mergedForFeed = takeHighestPriorityDecision(
|
|
28476
28480
|
post,
|