Skip to content
This repository has been archived by the owner on Jul 27, 2019. It is now read-only.

Commit

Permalink
Ignore bot nick when inserting zero width space.
Browse files Browse the repository at this point in the history
  • Loading branch information
cnaude committed Dec 3, 2015
1 parent 10d3597 commit 6e92407
Showing 1 changed file with 3 additions and 0 deletions.
Expand Up @@ -103,6 +103,9 @@ private String addZeroWidthSpace(String s) {
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());
Expand Down

0 comments on commit 6e92407

Please sign in to comment.