mirror of
https://github.com/cnaude/PurpleIRC-spigot.git
synced 2024-11-29 05:26:19 +01:00
Little more debugging for ZWS
This commit is contained in:
parent
015870f3c7
commit
c2fd0dded0
@ -118,7 +118,6 @@ public class IRCMessageQueueWatcher {
|
||||
"(?i)" + user.getNick(),
|
||||
Matcher.quoteReplacement(plugin.tokenizer.addZeroWidthSpace(user.getNick()))
|
||||
);
|
||||
plugin.logDebug("Adding ZWS to " + user.getNick());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1229,13 +1229,18 @@ public class ChatTokenizer {
|
||||
|
||||
public String addZeroWidthSpace(String s) {
|
||||
if (s.contains("\u200B")) {
|
||||
plugin.logDebug("Nick already contains ZWS: " + s);
|
||||
return s;
|
||||
}
|
||||
|
||||
if (s.length() > 1) {
|
||||
String a = s.substring(0, 1);
|
||||
String b = s.substring(1);
|
||||
return a + "\u200B" + b;
|
||||
String n = a + "\u200B" + b;
|
||||
plugin.logDebug("Adding ZWS: " + s + " -> " + n);
|
||||
return n;
|
||||
}
|
||||
plugin.logDebug("Nick too short for ZWS: " + s);
|
||||
return s;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user