// Copyright (c) 2014, Christopher "blay09" Baker
// All rights reserved.

package net.blay09.mods.eirairc.config.base;


public class ServiceSettings {
	
	private final String identifyCMD;
	private final String ghostCMD;
	
	public ServiceSettings(String identifyCMD, String ghostCMD) {
		this.identifyCMD = identifyCMD;
		this.ghostCMD = ghostCMD;
	}
	
	public String getIdentifyCommand(String username, String password) {
		return identifyCMD.replace("\\{USER\\}", username).replaceAll("\\{PASS\\}", password);
	}
	
	public String getGhostCommand(String nick, String password) {
		return ghostCMD.replace("\\{NICK\\}", nick).replaceAll("\\{PASS\\}", password);
	}

	public boolean hasGhostCommand() {
		return ghostCMD != null && !ghostCMD.isEmpty();
	}

}

@@ -451,17 +451,13 @@
 ce(%22
-%5C%5C
 %7BUSER
-%5C%5C
 %7D%22, 
@@ -469,38 +469,31 @@
 ame).replace
-All(%22%5C%5C
+(%22
 %7BPASS
-%5C%5C
 %7D%22, password
@@ -594,17 +594,13 @@
 ce(%22
-%5C%5C
 %7BNICK
-%5C%5C
 %7D%22, 
@@ -616,22 +616,15 @@
 lace
-All(%22%5C%5C
+(%22
 %7BPASS
-%5C%5C
 %7D%22, 

Fix Nickserv Authentication being broken.