|
|
|
@ -1508,8 +1508,7 @@ static void conv_write_im(PurpleConversation *conv, const char *who, const char
@@ -1508,8 +1508,7 @@ static void conv_write_im(PurpleConversation *conv, const char *who, const char
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
std::string timestamp; |
|
|
|
|
if (mtime && (unsigned long)time(NULL) - 10 > |
|
|
|
|
(unsigned long)mtime /* && (unsigned long) time(NULL) - 31536000 < (unsigned long) mtime*/) { |
|
|
|
|
if (mtime) { |
|
|
|
|
char buf[80]; |
|
|
|
|
strftime(buf, sizeof(buf), "%Y%m%dT%H%M%S", gmtime(&mtime)); |
|
|
|
|
timestamp = buf; |
|
|
|
@ -2132,29 +2131,27 @@ static bool initPurple() {
@@ -2132,29 +2131,27 @@ static bool initPurple() {
|
|
|
|
|
purple_debug_set_ui_ops(&debugUiOps); |
|
|
|
|
purple_debug_set_verbose(true); |
|
|
|
|
|
|
|
|
|
if (CONFIG_HAS_KEY(config, "purple.cacerts_dir")) { |
|
|
|
|
if (CONFIG_HAS_KEY(config, "purple.cacerts_dir")) { |
|
|
|
|
std::string cacertsDir = CONFIG_STRING(config, "purple.cacerts_dir"); |
|
|
|
|
LOG4CXX_INFO(logger, "Setting libpurple cacerts directory to: " << cacertsDir); |
|
|
|
|
purple_certificate_add_ca_search_path(cacertsDir.c_str()); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if (CONFIG_HAS_KEY(config, "purple.plugins_dir")) { |
|
|
|
|
std::string pluginsDir = CONFIG_STRING(config, "purple.plugins_dir"); |
|
|
|
|
LOG4CXX_INFO(logger, "Using custom libpurple plugin directory: " << pluginsDir); |
|
|
|
|
purple_plugins_add_search_path(pluginsDir.c_str()); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if (CONFIG_HAS_KEY(config, "purple.load_plugin")) { |
|
|
|
|
std::string file = CONFIG_STRING(config, "purple.load_plugin"); |
|
|
|
|
PurplePlugin *plugin = purple_plugin_probe(file.c_str()); |
|
|
|
|
if (plugin != NULL) { |
|
|
|
|
LOG4CXX_INFO(logger, "Loaded " << file << " (" << purple_plugin_get_name(plugin) << ")"); |
|
|
|
|
} |
|
|
|
|
else { |
|
|
|
|
LOG4CXX_ERROR(logger, "Failed to load " << file); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
if (CONFIG_HAS_KEY(config, "purple.plugins_dir")) { |
|
|
|
|
std::string pluginsDir = CONFIG_STRING(config, "purple.plugins_dir"); |
|
|
|
|
LOG4CXX_INFO(logger, "Using custom libpurple plugin directory: " << pluginsDir); |
|
|
|
|
purple_plugins_add_search_path(pluginsDir.c_str()); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if (CONFIG_HAS_KEY(config, "purple.load_plugin")) { |
|
|
|
|
std::string file = CONFIG_STRING(config, "purple.load_plugin"); |
|
|
|
|
PurplePlugin *plugin = purple_plugin_probe(file.c_str()); |
|
|
|
|
if (plugin != NULL) { |
|
|
|
|
LOG4CXX_INFO(logger, "Loaded " << file << " (" << purple_plugin_get_name(plugin) << ")"); |
|
|
|
|
} else { |
|
|
|
|
LOG4CXX_ERROR(logger, "Failed to load " << file); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
std::string tempDir = "/tmp/" + boost::filesystem::unique_path().string(); |
|
|
|
|
boost::filesystem::create_directories(tempDir); |
|
|
|
@ -2180,16 +2177,16 @@ static bool initPurple() {
@@ -2180,16 +2177,16 @@ static bool initPurple() {
|
|
|
|
|
|
|
|
|
|
purple_prefs_load(); |
|
|
|
|
|
|
|
|
|
std::string loaded_prpls = ""; |
|
|
|
|
GList* protocols = purple_plugins_get_protocols(); |
|
|
|
|
for (GList* proto = protocols; proto != NULL; proto = proto->next) { |
|
|
|
|
PurplePlugin* prpl = (PurplePlugin *) proto->data; |
|
|
|
|
loaded_prpls += purple_plugin_get_id(prpl); |
|
|
|
|
loaded_prpls += " ("; |
|
|
|
|
loaded_prpls += purple_plugin_get_name(prpl); |
|
|
|
|
loaded_prpls += ") "; |
|
|
|
|
} |
|
|
|
|
LOG4CXX_INFO(logger, "Loaded protocol plugins: " << loaded_prpls) |
|
|
|
|
std::string loaded_prpls = ""; |
|
|
|
|
GList *protocols = purple_plugins_get_protocols(); |
|
|
|
|
for (GList *proto = protocols; proto != NULL; proto = proto->next) { |
|
|
|
|
PurplePlugin *prpl = (PurplePlugin *)proto->data; |
|
|
|
|
loaded_prpls += purple_plugin_get_id(prpl); |
|
|
|
|
loaded_prpls += " ("; |
|
|
|
|
loaded_prpls += purple_plugin_get_name(prpl); |
|
|
|
|
loaded_prpls += ") "; |
|
|
|
|
} |
|
|
|
|
LOG4CXX_INFO(logger, "Loaded protocol plugins: " << loaded_prpls) |
|
|
|
|
|
|
|
|
|
/* Good default preferences */ |
|
|
|
|
/* The combination of these two settings mean that libpurple will never
|
|
|
|
|