Changeset - 93ddc62068ea
[Not reviewed]
0 3 0
HanzZ - 14 years ago 2011-08-18 00:29:46
hanzz.k@gmail.com
added [backend] no_vcard_fetch variable to stop fetching vcard from remote network and answer only with avatar
3 files changed with 15 insertions and 5 deletions:
0 comments (0 inline, 0 general)
backends/libpurple/main.cpp
Show inline comments
 
@@ -58,6 +58,7 @@ static GOptionEntry options_entries[] = {
 
	{ NULL, 0, 0, G_OPTION_ARG_NONE, NULL, "", NULL }
 
};
 

	
 
static void *notify_user_info(PurpleConnection *gc, const char *who, PurpleNotifyUserInfo *user_info);
 
static GHashTable *ui_info = NULL;
 

	
 
static GHashTable *spectrum_ui_get_info(void)
 
@@ -381,8 +382,18 @@ class SpectrumNetworkPlugin : public NetworkPlugin {
 
				if (CONFIG_STRING(config, "service.protocol") == "any" && legacyName.find("prpl-") == 0) {
 
					name = name.substr(name.find(".") + 1);
 
				}
 
				serv_get_info(purple_account_get_connection(account), name.c_str());
 
				m_vcards[user + name] = id;
 

	
 
				std::cout << name << " " << purple_account_get_username(account) << "\n";
 
				if (CONFIG_BOOL(config, "backend.no_vcard_fetch") && name != purple_account_get_username(account)) {
 
					PurpleNotifyUserInfo *user_info = purple_notify_user_info_new();
 
					notify_user_info(purple_account_get_connection(account), name.c_str(), user_info);
 
					purple_notify_user_info_destroy(user_info);
 
				}
 
				else {
 
					serv_get_info(purple_account_get_connection(account), name.c_str());
 
				}
 
				
 
			}
 
		}
 

	
spectrum/src/sample.cfg
Show inline comments
 
@@ -19,10 +19,8 @@ protocol=any
 
#protocol=prpl-icq
 

	
 
[backend]
 
default_avatar=catmelonhead.jpg
 
[purple]
 
test=test1
 
test2=test3
 
#default_avatar=catmelonhead.jpg
 
no_vcard_fetch=true
 

	
 
[logging]
 
#config=logging.cfg # log4cxx/log4j logging configuration file
src/config.cpp
Show inline comments
 
@@ -70,6 +70,7 @@ bool Config::load(const std::string &configfile, boost::program_options::options
 
		("logging.backend_config", value<std::string>()->default_value(""), "Path to log4cxx config file which is used for backends")
 
		("backend.default_avatar", value<std::string>()->default_value(""), "Full path to default avatar")
 
		("backend.avatars_directory", value<std::string>()->default_value(""), "Path to directory with avatars")
 
		("backend.no_vcard_fetch", value<bool>()->default_value(false), "True if VCards for buddies should not be fetched. Only avatars will be forwarded.")
 
	;
 

	
 
	parsed_options parsed = parse_config_file(ifs, opts, true);
0 comments (0 inline, 0 general)