35 lines
913 B
Java
35 lines
913 B
Java
|
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;
|
|||
|
}
|
|||
|
|
|||
|
}
|