soc.2009.transport: cc14b228: Make 'bind' key in config optional

hanzz at soc.pidgin.im hanzz at soc.pidgin.im
Tue Jul 21 10:20:37 EDT 2009


-----------------------------------------------------------------
Revision: cc14b228aad18aeffd45eaaa4e366aa74fae07e6
Ancestor: 5cd40461b074895f53f68961c62dcbb55fd4b80d
Author: hanzz at soc.pidgin.im
Date: 2009-07-21T14:17:37
Branch: im.pidgin.soc.2009.transport
URL: http://d.pidgin.im/viewmtn/revision/info/cc14b228aad18aeffd45eaaa4e366aa74fae07e6

Modified files:
        filetransfermanager.cpp main.cpp user.cpp

ChangeLog: 

Make 'bind' key in config optional

-------------- next part --------------
============================================================
--- filetransfermanager.cpp	7463e717a114f3ba22dd2077e73682572eba18dc
+++ filetransfermanager.cpp	8ea55fce1a2df5e83503c949580b8c81e32d8d4b
@@ -27,7 +27,7 @@ void FileTransferManager::handleFTReques
 }
 
 void FileTransferManager::handleFTRequest (const JID &from, const JID &to, const std::string &sid, const std::string &name, long size, const std::string &hash, const std::string &date, const std::string &mimetype, const std::string &desc, int stypes, long offset, long length) {
-	std::cout << "Received file transfer request from " << from.full() << ".\n";
+	std::cout << "Received file transfer request from " << from.full() << " " << to.full() << " " << sid << ".\n";
 	m_info[sid].filename = name;
 	m_info[sid].size = size;
 	m_sip->acceptFT(from, to, sid);
============================================================
--- main.cpp	7b01162d39c49e87a89dd47a78180b2c3f58160b
+++ main.cpp	4c30b5fccbaa9c3a0484da346818baafe2c34020
@@ -845,11 +845,13 @@ void GlooxMessageHandler::loadConfigFile
 	else
 		m_configuration.useProxy = false;
 
-	bind = g_key_file_get_string_list (keyfile,"purple","bind",NULL, NULL);
-	for (i = 0; bind[i]; i++){
-		m_configuration.bindIPs[i] = (std::string)bind[i];
+	if(g_key_file_has_key(keyfile,"purple","bind",NULL)) {
+		bind = g_key_file_get_string_list (keyfile,"purple","bind",NULL, NULL);
+		for (i = 0; bind[i]; i++){
+			m_configuration.bindIPs[i] = (std::string)bind[i];
+		}
+		g_strfreev (bind);
 	}
-	g_strfreev (bind);
 	
 	if(g_key_file_has_key(keyfile,"service","allowed_servers",NULL)) {
 		bind = g_key_file_get_string_list(keyfile, "service", "allowed_servers", NULL, NULL);
============================================================
--- user.cpp	613a56743fabeee1f1ac841b4fbd34907b26e7bb
+++ user.cpp	f20a842759ae68d583e0a348a7ba2d0408276e28
@@ -885,7 +885,8 @@ void User::connect(){
 	}
 	m_connectionStart = time(NULL);
 	m_readyForConnect = false;
-	purple_account_set_string(m_account,"bind",std::string(m_bindIP).c_str());
+	if (!m_bindIP.empty())
+		purple_account_set_string(m_account,"bind",std::string(m_bindIP).c_str());
 	purple_account_set_string(m_account,"lastUsedJid",m_userKey.c_str());
 	purple_account_set_password(m_account,m_password.c_str());
 	Log().Get(m_jid) << "UIN:" << m_username << " PASSWORD:" << m_password;


More information about the Commits mailing list