mirror of
https://github.com/PR0M3TH3AN/bitvid.git
synced 2026-10-28 16:32:28 +00:00
Merge pull request #1815 from PR0M3TH3AN/fix-moderation-test-mock-9853303796175767521
Fix userBlocks mock wiring in moderation test harness
This commit is contained in:
1 file changed
+10
@@ -272,6 +272,16 @@ export async function createModerationAppHarness(options = {}) {
|
||||
app.getActiveModerationThresholds =
|
||||
Application.prototype.getActiveModerationThresholds;
|
||||
|
||||
if (options.userBlocks) {
|
||||
app.isAuthorBlocked = function (pubkey) {
|
||||
const normalized = this.normalizeHexPubkey(pubkey);
|
||||
if (normalized && options.userBlocks.isBlocked(normalized)) {
|
||||
return true;
|
||||
}
|
||||
return Application.prototype.isAuthorBlocked.call(this, pubkey);
|
||||
};
|
||||
}
|
||||
|
||||
app.defaultModerationSettings = getDefaultModerationSettings();
|
||||
app.moderationSettings = { ...app.defaultModerationSettings };
|
||||
|
||||
|
||||
Reference in new issue
Block a user