CTCV2/app/src/main/java/com/discord/utilities/textprocessing/Rules.java

35 lines
913 B
Java
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

package com.discord.utilities.textprocessing;
import com.PatchConfig;
import java.util.regex.Pattern;
import lanchon.dexpatcher.annotation.DexAdd;
import lanchon.dexpatcher.annotation.DexEdit;
@DexEdit
public class Rules {
// pseudonitro-viewer patch
@DexEdit
private static Pattern PATTERN_CUSTOM_EMOJI = ctc_getCustomEmojiPattern();
@DexAdd
private static final Pattern ctc_PATTERN_CUSTOM_EMOJI_ORIGINAL = Pattern.compile("^<(a)?:([a-zA-Z_0-9]+):(\\d+)>");
@DexAdd
private static final Pattern ctc_PATTERN_CUSTOM_EMOJI_PSEUDONITRO = Pattern.compile("^<&??(a)?:([a-zA-Z_0-9]+):(\\d+)>");
@DexAdd
private static Pattern ctc_getCustomEmojiPattern() {
if (!PatchConfig.PSEUDONITRO_VIEWER_ENABLED) {
// Patch not enabled
return ctc_PATTERN_CUSTOM_EMOJI_ORIGINAL;
}
return ctc_PATTERN_CUSTOM_EMOJI_PSEUDONITRO;
}
}