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

Commit

Permalink
Properly enforce custom-tab-list option. #84
Browse files Browse the repository at this point in the history
  • Loading branch information
cnaude committed Sep 22, 2014
1 parent 110ab16 commit 8071556
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 7 deletions.
1 change: 1 addition & 0 deletions pom.xml
Expand Up @@ -36,6 +36,7 @@
<enabled>false</enabled>
</snapshots>
</repository>

<!-- Bukkit -->
<repository>
<id>bukkit-repo</id>
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/com/cnaude/purpleirc/PurpleIRC.java
Expand Up @@ -122,7 +122,7 @@ public class PurpleIRC extends JavaPlugin {
private boolean stripGameColors;
private boolean stripIRCColors;
private boolean stripIRCBackgroundColors;
private boolean customTabList;
public boolean customTabList;
private boolean listSortByName;
public boolean exactNickMatch;
public boolean ignoreChatCancel;
Expand Down
14 changes: 8 additions & 6 deletions src/main/java/com/cnaude/purpleirc/Utilities/NetPackets.java
Expand Up @@ -39,6 +39,9 @@ public NetPackets(PurpleIRC plugin) {
* @param channel
*/
public void addToTabList(String name, PurpleBot ircBot, Channel channel) {
if (! plugin.customTabList) {
return;
}
String channelName = channel.getName();
if (ircBot.tabIgnoreNicks.containsKey(channelName)) {
if (ircBot.tabIgnoreNicks.get(channelName).contains(name)) {
Expand All @@ -56,9 +59,7 @@ public void addToTabList(String name, PurpleBot ircBot, Channel channel) {
protocolManager.sendServerPacket(reciever, packet);
}
}
} catch (FieldAccessException e) {
plugin.logError(e.getMessage());
} catch (InvocationTargetException e) {
} catch (FieldAccessException | InvocationTargetException e) {
plugin.logError(e.getMessage());
}
}
Expand All @@ -68,6 +69,9 @@ public void addToTabList(String name, PurpleBot ircBot, Channel channel) {
* @param name
*/
public void remFromTabList(String name) {
if (! plugin.customTabList) {
return;
}
playerListConstructor = protocolManager.createPacketConstructor(Packets.Server.PLAYER_INFO, "", false, (int) 0);
try {
PacketContainer packet = playerListConstructor.createPacket(
Expand All @@ -77,9 +81,7 @@ public void remFromTabList(String name) {
protocolManager.sendServerPacket(reciever, packet);
}
}
} catch (FieldAccessException e) {
plugin.logError(e.getMessage());
} catch (InvocationTargetException e) {
} catch (FieldAccessException | InvocationTargetException e) {
plugin.logError(e.getMessage());
}
}
Expand Down

0 comments on commit 8071556

Please sign in to comment.