Index: /trunk/msg.cpp
===================================================================
--- /trunk/msg.cpp	(revision 10)
+++ /trunk/msg.cpp	(revision 11)
@@ -7,5 +7,9 @@
 namespace Protocol
 {
-	// parser
+	Message::Message()
+	{
+		mObject[ProtocolType::TYPE] = ProtocolType::NONE;
+	}
+
 	void Message::parse(const std::string & message)
 	{
@@ -15,5 +19,5 @@
 	std::string Message::type() const
 	{
-		return get<std::string>("type");
+		return get<std::string>(ProtocolType::TYPE);
 	}
 
@@ -29,5 +33,5 @@
 			SFriend fr;
 
-			fr.id   = (*iter)[ProtocolType::ID  ];
+			fr.id   = (*iter)[ProtocolType::ID];
 			fr.name = (*iter)[ProtocolType::NAME];
 
@@ -146,5 +150,5 @@
 			json::Object fr;
 
-			fr[ProtocolType::ID  ] = iter->id;
+			fr[ProtocolType::ID] = iter->id;
 			fr[ProtocolType::NAME] = iter->name;
 
Index: /trunk/msg.hpp
===================================================================
--- /trunk/msg.hpp	(revision 10)
+++ /trunk/msg.hpp	(revision 11)
@@ -23,4 +23,5 @@
 #define DECLARE_KEY(_t)	static const std::string _t = #_t
 
+	DECLARE_KEY(NONE);
 	DECLARE_KEY(ID);
 	DECLARE_KEY(TYPE);
@@ -41,4 +42,5 @@
 	DECLARE_KEY(GET_FRIEND_LIST);
 	DECLARE_KEY(FRIEND_LIST);
+	DECLARE_KEY(ID_LIST);
 	DECLARE_KEY(RESULT);
 }
@@ -52,5 +54,7 @@
 
 	public:
-		void parse(const std::string & message);
+		Message();
+
+		inline void parse(const std::string & message);
 
 		template<typename T>
@@ -60,7 +64,19 @@
 		}
 
+		template<typename T>
+		inline std::vector<T> getList(const std::string & key) const
+		{
+			std::vector<T> ret;
+			json::Array ar = mObject[key];
+
+			for (size_t iter = 0; iter < ar.size(); iter++)
+				ret.push_back(ar[iter]);
+
+			return ret;
+		}
+
 		inline std::vector<SFriend> getFriendList() const;
 
-		std::string type() const;
+		inline std::string type() const;
 	};
 
@@ -77,23 +93,23 @@
 
 	public:
-		void setUserID(const std::string & id);
+		inline void setUserID(const std::string & id);
 
-		const std::string & getUserID();
+		inline const std::string & getUserID();
 
-		void makeTemplate(json::Object & obj, const std::string & type) const;
+		inline void makeTemplate(json::Object & obj, const std::string & type) const;
 
-		std::string sms(const std::string & phone) const;
+		inline std::string sms(const std::string & phone) const;
 
-		std::string join(const std::string & id, const std::string & pw, const std::string & sms);
+		inline std::string join(const std::string & id, const std::string & pw, const std::string & sms);
 
-		std::string login(const std::string & pw) const;
+		inline std::string login(const std::string & pw) const;
 
-		std::string addFriend(const std::string & id) const;
+		inline std::string addFriend(const std::string & id) const;
 
-		std::string openSession(const std::string & to) const;
+		inline std::string openSession(const std::string & to) const;
 
-		std::string chat(const std::string & sessid, const std::string & message, const int sensitive) const;
+		inline std::string chat(const std::string & sessid, const std::string & message, const int sensitive) const;
 
-		std::string getFriendList() const;
+		inline std::string getFriendList() const;
 	};
 
@@ -101,11 +117,11 @@
 	{
 	public:
-		void makeTemplate(json::Object & obj, const std::string & type) const;
+		inline void makeTemplate(json::Object & obj, const std::string & type) const;
 
-		std::string result(const std::string & requestType, const bool status) const;
+		inline std::string result(const std::string & requestType, const bool status) const;
 
-		std::string friendList(const std::vector<SFriend> & friendList) const;
+		inline std::string friendList(const std::vector<SFriend> & friendList) const;
 
-		std::string openSession(const std::vector<std::string> & idList) const;
+		inline std::string openSession(const std::vector<std::string> & idList) const;
 	};
 };
@@ -134,2 +150,12 @@
 			  << message << std::endl;
 }
+
+static std::string joinStrings(const std::vector<std::string> & strings)
+{
+	std::string concat = strings[0];
+
+	for (size_t iter = 1; iter < strings.size(); iter++)
+		concat += DELIMITER + strings[iter];
+
+	return concat;
+}
