package org.muteswan.client.data;

import org.json.JSONException;
import org.json.JSONObject;

public class MuteswanServer {

	
	private String hostname;
	private ServerInfo serverInfo;
	
	
	public class ServerInfo {
		public String Name = "";
		
		public void setName(String arg) {
			this.Name = arg;
		}
		
		public String getName() {
			return Name;
		}
	}
	
	public ServerInfo getServerInfo() {
		return serverInfo;
	}
	
	public String getHostname() {
		return hostname;
	}
	
	public String toString() {
		if (serverInfo.getName() != null && serverInfo.getName() != "" && !serverInfo.getName().equals("defaultname")) {
			return serverInfo.getName();
		} else {
			return serverInfo.getName() + " (" + getHostname() + ")";
		} 
	}
	
	public void init(String server, JSONObject jsonObj) {
		this.hostname = server;
		serverInfo = new ServerInfo();
		try {
			serverInfo.setName(jsonObj.getString("Name"));
		} catch (JSONException e) {
			e.printStackTrace();
			return;
		}
		
	}
	
	
}

@@ -86,16 +86,52 @@
 NObject;
+%0Aimport org.muteswan.client.MuteLog;
 %0A%0Apublic
@@ -538,16 +538,19 @@
 ing() %7B%0A
+%09%09%0A
 %09%09if (se
@@ -579,16 +579,17 @@
 null && 
+!
 serverIn
@@ -604,14 +604,19 @@
 me()
- != 
+.equals(
 %22%22
+)
  && 

Fix empty servername problem when initially adding server.