From 5071014d7fe28cdbadd6ff41f3b33340df59b04f Mon Sep 17 00:00:00 2001 From: cnaude Date: Tue, 24 May 2016 07:28:56 -0700 Subject: [PATCH] Add nick-prefix.owner option --- src/main/java/com/cnaude/purpleirc/PurpleBot.java | 6 ++++-- src/main/java/com/cnaude/purpleirc/PurpleIRC.java | 2 ++ src/main/resources/config.yml | 1 + 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/cnaude/purpleirc/PurpleBot.java b/src/main/java/com/cnaude/purpleirc/PurpleBot.java index 98b1bf2..f3aed82 100644 --- a/src/main/java/com/cnaude/purpleirc/PurpleBot.java +++ b/src/main/java/com/cnaude/purpleirc/PurpleBot.java @@ -651,7 +651,7 @@ public final class PurpleBot { } }); } - + public void asyncJoinChannel(final String channelName) { if (!this.isConnected()) { return; @@ -866,7 +866,7 @@ public final class PurpleBot { // load tailer settings tailerEnabled = config.getBoolean("file-tailer.enabled", false); - + joinOnKick = config.getBoolean("join-on-kick", true); String tailerFile = config.getString("file-tailer.file", "server.log"); @@ -2395,6 +2395,8 @@ public final class PurpleBot { if (user.getChannels() != null) { if (user.isIrcop()) { return plugin.ircNickPrefixIrcOp; + } else if (user.getChannelsOwnerIn().contains(channel)) { + return plugin.ircNickPrefixOwner; } else if (user.getChannelsSuperOpIn().contains(channel)) { return plugin.ircNickPrefixSuperOp; } else if (user.getChannelsOpIn().contains(channel)) { diff --git a/src/main/java/com/cnaude/purpleirc/PurpleIRC.java b/src/main/java/com/cnaude/purpleirc/PurpleIRC.java index 67a7a70..2796ae7 100644 --- a/src/main/java/com/cnaude/purpleirc/PurpleIRC.java +++ b/src/main/java/com/cnaude/purpleirc/PurpleIRC.java @@ -143,6 +143,7 @@ public class PurpleIRC extends JavaPlugin { listSeparator, listPlayer, ircNickPrefixIrcOp, + ircNickPrefixOwner, ircNickPrefixSuperOp, ircNickPrefixOp, ircNickPrefixHalfOp, @@ -692,6 +693,7 @@ public class PurpleIRC extends JavaPlugin { defaultPlayerWorld = ChatColor.translateAlternateColorCodes('&', getConfig().getString(msgFormatSection + ".default-player-world", "")); ircNickPrefixIrcOp = ChatColor.translateAlternateColorCodes('&', getConfig().getString("nick-prefixes.ircop", "~")); + ircNickPrefixOwner = ChatColor.translateAlternateColorCodes('&', getConfig().getString("nick-prefixes.owner", "@")); ircNickPrefixSuperOp = ChatColor.translateAlternateColorCodes('&', getConfig().getString("nick-prefixes.ircsuperop", "&&")); ircNickPrefixOp = ChatColor.translateAlternateColorCodes('&', getConfig().getString("nick-prefixes.op", "@")); ircNickPrefixHalfOp = ChatColor.translateAlternateColorCodes('&', getConfig().getString("nick-prefixes.halfop", "%")); diff --git a/src/main/resources/config.yml b/src/main/resources/config.yml index 4524987..97593f6 100644 --- a/src/main/resources/config.yml +++ b/src/main/resources/config.yml @@ -322,6 +322,7 @@ nick-exact-match: true # IRC nick prefixes (can include & color codes) nick-prefixes: ircop: '&4~' + owner: '&5@' ircsuperop: '&6&&' op: '&c@' halfop: '&3%'