summaryrefslogtreecommitdiff
path: root/libpurple/purplehistorymanager.c
diff options
context:
space:
mode:
authorGary Kramlich <grim@reaperworld.com>2021-10-18 02:01:37 -0500
committerGary Kramlich <grim@reaperworld.com>2021-10-18 02:01:37 -0500
commit25855c9d62f63c81be44849a5f282184d8bd56c1 (patch)
treef3c83dc898dc8fd37b4b61e2fcbc60457a37ea18 /libpurple/purplehistorymanager.c
parent55fd0754377b9ef459e35da750eed571fdb2a081 (diff)
downloadpidgin-25855c9d62f63c81be44849a5f282184d8bd56c1.tar.gz
Make user interfaces setup the default history adapter.
This helps avoid some issues with the unit tests as well as gives us more flexibility in the future. Testing Done: Ran the unit tests without issue. Ran Pidgin 3 with no existing config directory and verified that `history.db` was created properly. Reviewed at https://reviews.imfreedom.org/r/1033/
Diffstat (limited to 'libpurple/purplehistorymanager.c')
-rw-r--r--libpurple/purplehistorymanager.c33
1 files changed, 0 insertions, 33 deletions
diff --git a/libpurple/purplehistorymanager.c b/libpurple/purplehistorymanager.c
index 02f7039a3c..44fea88699 100644
--- a/libpurple/purplehistorymanager.c
+++ b/libpurple/purplehistorymanager.c
@@ -148,40 +148,7 @@ purple_history_manager_class_init(PurpleHistoryManagerClass *klass) {
void
purple_history_manager_startup(void) {
if(default_manager == NULL) {
- PurpleHistoryAdapter *adapter = NULL;
- GError *error = NULL;
- gchar *filename = NULL;
-
- filename = g_build_filename(purple_config_dir(), "history.db", NULL);
- adapter = purple_sqlite_history_adapter_new(filename);
- g_free(filename);
-
default_manager = g_object_new(PURPLE_TYPE_HISTORY_MANAGER, NULL);
- if(!purple_history_manager_register(default_manager, adapter, &error)) {
- if(error != NULL) {
- g_warning("Failed to register sqlite history adapter: %s", error->message);
- g_clear_error(&error);
- } else {
- g_warning("Failed to register sqlite history adapter: Unknown reason");
- }
-
- g_clear_object(&adapter);
-
- return;
- }
-
- purple_history_manager_set_active(default_manager,
- purple_history_adapter_get_id(adapter),
- &error);
-
- if(error != NULL) {
- g_warning("Failed to activate %s: %s",
- purple_history_adapter_get_id(adapter), error->message);
-
- g_clear_error(&error);
- }
-
- g_clear_object(&adapter);
}
}