soc.2009.transport: 32415bb1: Backported bugfixes from Jabbim server.

hanzz at soc.pidgin.im hanzz at soc.pidgin.im
Sat Jun 27 23:55:29 EDT 2009


-----------------------------------------------------------------
Revision: 32415bb1785c07727dc0800839c5fc3d132248b6
Ancestor: fa5af6f634857afd36945d0b22de4c58e0a1649f
Author: hanzz at soc.pidgin.im
Date: 2009-06-28T03:50:19
Branch: im.pidgin.soc.2009.transport
URL: http://d.pidgin.im/viewmtn/revision/info/32415bb1785c07727dc0800839c5fc3d132248b6

Modified files:
        main.cpp main.h user.cpp

ChangeLog: 

Backported bugfixes from Jabbim server.

-------------- next part --------------
============================================================
--- main.cpp	4c19d73fd5a5a82972e578fe84eca8d0ec8ac2d1
+++ main.cpp	a1777b1d333e4470150e3ec2d23d594ffbbb2984
@@ -890,7 +890,12 @@ void GlooxMessageHandler::loadConfigFile
 		m_configuration.onlyForVIP=g_key_file_get_boolean(keyfile, "service","only_for_vip", NULL);
 	else
 		m_configuration.onlyForVIP=false;
-	
+
+	if(g_key_file_has_key(keyfile,"service","use_proxy",NULL))
+		m_configuration.useProxy=g_key_file_get_boolean(keyfile, "service","use_proxy", NULL);
+	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];
============================================================
--- main.h	d1d93d6f021151a2c38cdae40b849a3ab82c00f6
+++ main.h	47b49155f81a53b7099f0343e4da5642613af416
@@ -133,6 +133,7 @@ struct Configuration {
 	int port;				// server port
 	
 	bool onlyForVIP;		// true if transport is only for users in VIP users database
+	bool userProxy;
 	std::list <std::string> allowedServers;
 	std::map<int,std::string> bindIPs;	// IP address to which libpurple should bind connections
 	
============================================================
--- user.cpp	d5cc5efc3d645145513508be6588ff4c8768db97
+++ user.cpp	96a494556e90fcb447d9af976d3c7532abdca3d2
@@ -27,6 +27,7 @@
 #include "muchandler.h"
 #include "cmds.h"
 #include "parser.h"
+#include "proxy.h"
 
 /*
  * Called when contact list has been received from legacy network.
@@ -858,6 +859,15 @@ void User::connect(){
 	purple_account_set_password(m_account,m_password.c_str());
 	Log().Get(m_jid) << "UIN:" << m_username << " PASSWORD:" << m_password;
 
+	if (p->configuration->useProxy) {
+		PurpleProxyInfo *info = purple_proxy_info_new();
+		purple_proxy_info_set_type(info, PURPLE_PROXY_USE_ENVVAR);
+		info->username = NULL;
+		info->password = NULL;
+		purple_account_set_proxy_info(m_account, info);
+	}
+
+
 	// check if it's valid uin
 	bool valid = false;
 	if (!m_username.empty()){
@@ -1065,6 +1075,8 @@ void User::receivedPresence(const Presen
 
 	if (m_lang == NULL) {
 		Tag *tag = stanza.tag();
+		if (!tag)
+			return;
 		std::string lang = tag->findAttribute("xml:lang");
 		Log().Get("LANG") << tag->xml();
 		delete tag;


More information about the Commits mailing list