Ignore bot nick when inserting zero width space. #10

This commit is contained in:
cnaude 2015-12-02 20:34:39 -07:00
parent 1bb118bf45
commit 72a0d9dace

View File

@ -103,6 +103,9 @@ public class IRCMessageQueueWatcher {
private String pingFix(String message) {
for (Channel channel : ircBot.bot.getUserBot().getChannels()) {
for (User user : channel.getUsers()) {
if (user.getNick().equalsIgnoreCase(ircBot.botNick)) {
continue;
}
if (message.toLowerCase().contains(user.getNick().toLowerCase())) {
message = message.replaceAll("(?i)" + user.getNick(), addZeroWidthSpace(user.getNick()));
plugin.logDebug("Adding ZWS to " + user.getNick());