fix logic around repeat posts with or without media embeds: (#3042)

This commit is contained in:
Tessa Thornton
2020-07-23 15:36:08 -06:00
committed by GitHub
parent e90272aa58
commit 25a1dcdf8d
@@ -57,6 +57,13 @@ export const repeatPost: IntermediateModerationPhase = async ({
// Giphy is enabled. If the medias are the same, then this is a repeat
// comment otherwise they are not.
if (
(!lastCommentRevision.media && !media) ||
(lastCommentRevision.media && !media)
) {
// comment body was the same and neither comment has media OR the previous
// comment had media but the current one does not
similarity = true;
} else if (
// Check to see if the last comment revision has a Giphy Media
// object.
lastCommentRevision.media &&
@@ -76,7 +83,7 @@ export const repeatPost: IntermediateModerationPhase = async ({
}
} else {
// Body text was the same and Giphy support was not enabled.
similarity = false;
similarity = true;
}
if (similarity) {