default avatar

This commit is contained in:
HanzZ 2011-07-19 20:46:38 +02:00
parent 3450eb8796
commit 9365c89b7a
3 changed files with 18 additions and 0 deletions

View file

@ -179,6 +179,19 @@ class SpectrumNetworkPlugin : public NetworkPlugin {
}
m_sessions[user] = account;
// Default avatar
if (!CONFIG_STRING(config, "backend.default_avatar").empty()) {
char* contents;
gsize length;
gboolean ret = g_file_get_contents (CONFIG_STRING(config, "backend.default_avatar").c_str(),
&contents, &length, NULL);
if (ret) {
purple_buddy_icons_set_account_icon(account, (guchar *) contents, length);
}
}
purple_account_set_password(account, password.c_str());
purple_account_set_enabled(account, "spectrum", TRUE);

View file

@ -17,6 +17,9 @@ protocol=prpl-jabber
#protocol=prpl-msn
#protocol=prpl-icq
[backend]
default_avatar=catmelonhead.jpg
[logging]
#config=logging.cfg # log4cxx/log4j logging configuration file
#backend_config=backend_logging.cfg # log4cxx/log4j logging configuration file for backends

View file

@ -60,6 +60,8 @@ bool Config::load(const std::string &configfile, boost::program_options::options
("database.prefix", value<std::string>()->default_value(""), "Prefix of tables in database")
("logging.config", value<std::string>()->default_value(""), "Path to log4cxx config file which is used for Spectrum 2 instance")
("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")
;
store(parse_config_file(ifs, opts), m_variables);