libpurple/core.c

Sat, 05 Apr 2014 19:49:01 +0200

author
Tomasz Wasilczyk <twasilczyk@pidgin.im>
date
Sat, 05 Apr 2014 19:49:01 +0200
changeset 35778
8ea15abd8688
parent 35776
901a94245460
child 35787
8738f1797803
permissions
-rw-r--r--

Comments: PurpleSmileyTheme

20147
66f05a854eee applied changes from 8a731bbd0197fbcc91a705c2d8f528154216defa
Richard Laager <rlaager@pidgin.im>
parents: 19859
diff changeset
1 /* purple
2416
32a1499fe87e [gaim-migrate @ 2429]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
diff changeset
2 *
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15678
diff changeset
3 * Purple is the legal property of its developers, whose names are too numerous
8046
c581b20a47d6 [gaim-migrate @ 8730]
Sean Egan <seanegan@pidgin.im>
parents: 7646
diff changeset
4 * to list here. Please refer to the COPYRIGHT file distributed with this
c581b20a47d6 [gaim-migrate @ 8730]
Sean Egan <seanegan@pidgin.im>
parents: 7646
diff changeset
5 * source distribution.
2416
32a1499fe87e [gaim-migrate @ 2429]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
diff changeset
6 *
32a1499fe87e [gaim-migrate @ 2429]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
diff changeset
7 * This program is free software; you can redistribute it and/or modify
32a1499fe87e [gaim-migrate @ 2429]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
diff changeset
8 * it under the terms of the GNU General Public License as published by
32a1499fe87e [gaim-migrate @ 2429]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
diff changeset
9 * the Free Software Foundation; either version 2 of the License, or
32a1499fe87e [gaim-migrate @ 2429]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
diff changeset
10 * (at your option) any later version.
32a1499fe87e [gaim-migrate @ 2429]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
diff changeset
11 *
32a1499fe87e [gaim-migrate @ 2429]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
diff changeset
12 * This program is distributed in the hope that it will be useful,
32a1499fe87e [gaim-migrate @ 2429]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
diff changeset
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
32a1499fe87e [gaim-migrate @ 2429]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
diff changeset
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
32a1499fe87e [gaim-migrate @ 2429]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
diff changeset
15 * GNU General Public License for more details.
32a1499fe87e [gaim-migrate @ 2429]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
diff changeset
16 *
32a1499fe87e [gaim-migrate @ 2429]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
diff changeset
17 * You should have received a copy of the GNU General Public License
32a1499fe87e [gaim-migrate @ 2429]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
diff changeset
18 * along with this program; if not, write to the Free Software
19859
71d37b57eff2 The FSF changed its address a while ago; our files were out of date.
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 19675
diff changeset
19 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA
2416
32a1499fe87e [gaim-migrate @ 2429]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
diff changeset
20 */
6179
4df73df94250 [gaim-migrate @ 6664]
Christian Hammond <chipx86@chipx86.com>
parents: 6168
diff changeset
21 #include "internal.h"
10684
0325b164a7eb [gaim-migrate @ 12231]
Luke Schierer <lschiere@pidgin.im>
parents: 10504
diff changeset
22 #include "cipher.h"
18477
47243c0d52c6 - Certificate system now has init and uninit like other systems
William Ehlhardt <williamehlhardt@gmail.com>
parents: 18303
diff changeset
23 #include "certificate.h"
23555
82dab41b4163 cmd-added and cmd-removed signals to emit when commands are registered/unregistered.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 23345
diff changeset
24 #include "cmds.h"
6179
4df73df94250 [gaim-migrate @ 6664]
Christian Hammond <chipx86@chipx86.com>
parents: 6168
diff changeset
25 #include "connection.h"
4df73df94250 [gaim-migrate @ 6664]
Christian Hammond <chipx86@chipx86.com>
parents: 6168
diff changeset
26 #include "conversation.h"
4df73df94250 [gaim-migrate @ 6664]
Christian Hammond <chipx86@chipx86.com>
parents: 6168
diff changeset
27 #include "core.h"
4df73df94250 [gaim-migrate @ 6664]
Christian Hammond <chipx86@chipx86.com>
parents: 6168
diff changeset
28 #include "debug.h"
14300
68a0aa63f3b8 [gaim-migrate @ 16920]
Mark Doliner <markdoliner@pidgin.im>
parents: 14286
diff changeset
29 #include "dnsquery.h"
34910
60502558e400 Replacements for the GObject Xfer API
Ankit Vani <a@nevitus.org>
parents: 34883
diff changeset
30 #include "xfer.h"
33882
29a7df06f410 Fix a warning for glib 2.36 and g_type_init
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 33643
diff changeset
31 #include "glibcompat.h"
33439
178eb69a3f11 Handle redirects
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 31590
diff changeset
32 #include "http.h"
12272
4eee92ead973 [gaim-migrate @ 14574]
Mark Doliner <markdoliner@pidgin.im>
parents: 12129
diff changeset
33 #include "idle.h"
16437
7ff7c3405ea2 Rework the buddy icon subsystem to use the imgstore subsystem, and modify the
Richard Laager <rlaager@pidgin.im>
parents: 16409
diff changeset
34 #include "imgstore.h"
33982
58a0de711782 Added support for the PURPLE_PLUGIN_FLAG_AUTOLOAD flag, corrected a few bugs and crashed. The compatibility plugin is automatically loaded at startup, and works nicely in compatibility mode (read_sync, write_sync, import, export). Also, I played unsuccessfully with makefiles, so i moved the keyring up one directory. I've finally gotten to the point where I run "make && sudo make install" every now and then.
Vivien Bernet-Rollande <scrouaf@soc.pidgin.im>
parents: 23847
diff changeset
35 #include "keyring.h"
8231
347c8992c445 [gaim-migrate @ 8954]
Tim Ringenbach <marv@pidgin.im>
parents: 8046
diff changeset
36 #include "network.h"
12129
314cd0274e6a [gaim-migrate @ 14429]
Ka-Hing Cheung <khc@pidgin.im>
parents: 12080
diff changeset
37 #include "notify.h"
6179
4df73df94250 [gaim-migrate @ 6664]
Christian Hammond <chipx86@chipx86.com>
parents: 6168
diff changeset
38 #include "plugin.h"
4df73df94250 [gaim-migrate @ 6664]
Christian Hammond <chipx86@chipx86.com>
parents: 6168
diff changeset
39 #include "pounce.h"
4df73df94250 [gaim-migrate @ 6664]
Christian Hammond <chipx86@chipx86.com>
parents: 6168
diff changeset
40 #include "prefs.h"
4df73df94250 [gaim-migrate @ 6664]
Christian Hammond <chipx86@chipx86.com>
parents: 6168
diff changeset
41 #include "proxy.h"
10418
7b632343a29c [gaim-migrate @ 11669]
Mark Doliner <markdoliner@pidgin.im>
parents: 10322
diff changeset
42 #include "savedstatuses.h"
6485
3c7ba18e32f1 [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents: 6371
diff changeset
43 #include "signals.h"
35715
2aa79f05247e Custom smileys storage
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 35703
diff changeset
44 #include "smiley-custom.h"
35703
238e0042049a PurpleSmileyTheme: abstract implementation
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 35698
diff changeset
45 #include "smiley-theme.h"
14300
68a0aa63f3b8 [gaim-migrate @ 16920]
Mark Doliner <markdoliner@pidgin.im>
parents: 14286
diff changeset
46 #include "sound.h"
24378
cb0bf512e61d renamed sound-loader.[ch] to sound-theme-loader.[ch]
Gary Kramlich <grim@reaperworld.com>
parents: 23962
diff changeset
47 #include "sound-theme-loader.h"
6701
7e2db9273748 [gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents: 6612
diff changeset
48 #include "sslconn.h"
9944
71ef020ec4b0 [gaim-migrate @ 10838]
Christian Hammond <chipx86@chipx86.com>
parents: 9649
diff changeset
49 #include "status.h"
11424
b0f8535daa74 [gaim-migrate @ 13661]
Thomas Butter <tbutter@users.sourceforge.net>
parents: 11281
diff changeset
50 #include "stun.h"
25884
c00e14c20165 * Alphabetize files in a few Makefile.am files
Mark Doliner <markdoliner@pidgin.im>
parents: 25871
diff changeset
51 #include "theme-manager.h"
16409
8c153c6febdd The core portion of the migration code. This is implemented as I described
Richard Laager <rlaager@pidgin.im>
parents: 16124
diff changeset
52 #include "util.h"
2416
32a1499fe87e [gaim-migrate @ 2429]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
diff changeset
53
11171
a25653d60f9c [gaim-migrate @ 13272]
Piotr Zielinski <zielaj@users.sourceforge.net>
parents: 11033
diff changeset
54 #ifdef HAVE_DBUS
22582
838faa931042 Avoid a compile warning when building with NetworkManager support because
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 21503
diff changeset
55 # ifndef DBUS_API_SUBJECT_TO_CHANGE
838faa931042 Avoid a compile warning when building with NetworkManager support because
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 21503
diff changeset
56 # define DBUS_API_SUBJECT_TO_CHANGE
838faa931042 Avoid a compile warning when building with NetworkManager support because
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 21503
diff changeset
57 # endif
17121
43d41f5ce17b Alternative dbus_uniq implementation
Gabriel Schulhof <nix@go-nix.ca>
parents: 16763
diff changeset
58 # include <dbus/dbus.h>
43d41f5ce17b Alternative dbus_uniq implementation
Gabriel Schulhof <nix@go-nix.ca>
parents: 16763
diff changeset
59 # include "dbus-purple.h"
11171
a25653d60f9c [gaim-migrate @ 13272]
Piotr Zielinski <zielaj@users.sourceforge.net>
parents: 11033
diff changeset
60 # include "dbus-server.h"
17121
43d41f5ce17b Alternative dbus_uniq implementation
Gabriel Schulhof <nix@go-nix.ca>
parents: 16763
diff changeset
61 # include "dbus-bindings.h"
11171
a25653d60f9c [gaim-migrate @ 13272]
Piotr Zielinski <zielaj@users.sourceforge.net>
parents: 11033
diff changeset
62 #endif
a25653d60f9c [gaim-migrate @ 13272]
Piotr Zielinski <zielaj@users.sourceforge.net>
parents: 11033
diff changeset
63
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15678
diff changeset
64 struct PurpleCore
6179
4df73df94250 [gaim-migrate @ 6664]
Christian Hammond <chipx86@chipx86.com>
parents: 6168
diff changeset
65 {
4df73df94250 [gaim-migrate @ 6664]
Christian Hammond <chipx86@chipx86.com>
parents: 6168
diff changeset
66 char *ui;
4df73df94250 [gaim-migrate @ 6664]
Christian Hammond <chipx86@chipx86.com>
parents: 6168
diff changeset
67
4df73df94250 [gaim-migrate @ 6664]
Christian Hammond <chipx86@chipx86.com>
parents: 6168
diff changeset
68 void *reserved;
4df73df94250 [gaim-migrate @ 6664]
Christian Hammond <chipx86@chipx86.com>
parents: 6168
diff changeset
69 };
4df73df94250 [gaim-migrate @ 6664]
Christian Hammond <chipx86@chipx86.com>
parents: 6168
diff changeset
70
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15678
diff changeset
71 static PurpleCoreUiOps *_ops = NULL;
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15678
diff changeset
72 static PurpleCore *_core = NULL;
6179
4df73df94250 [gaim-migrate @ 6664]
Christian Hammond <chipx86@chipx86.com>
parents: 6168
diff changeset
73
4df73df94250 [gaim-migrate @ 6664]
Christian Hammond <chipx86@chipx86.com>
parents: 6168
diff changeset
74 STATIC_PROTO_INIT
4df73df94250 [gaim-migrate @ 6664]
Christian Hammond <chipx86@chipx86.com>
parents: 6168
diff changeset
75
34297
0f1f0b8c84f8 Fix some debug log warnings, adjust verbosity level
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34165
diff changeset
76 static void
0f1f0b8c84f8 Fix some debug log warnings, adjust verbosity level
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34165
diff changeset
77 purple_core_print_version(void)
0f1f0b8c84f8 Fix some debug log warnings, adjust verbosity level
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34165
diff changeset
78 {
0f1f0b8c84f8 Fix some debug log warnings, adjust verbosity level
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34165
diff changeset
79 GHashTable *ui_info = purple_core_get_ui_info();
0f1f0b8c84f8 Fix some debug log warnings, adjust verbosity level
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34165
diff changeset
80 const gchar *ui_name;
0f1f0b8c84f8 Fix some debug log warnings, adjust verbosity level
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34165
diff changeset
81 const gchar *ui_version;
0f1f0b8c84f8 Fix some debug log warnings, adjust verbosity level
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34165
diff changeset
82 gchar *ui_full_name = NULL;
0f1f0b8c84f8 Fix some debug log warnings, adjust verbosity level
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34165
diff changeset
83
0f1f0b8c84f8 Fix some debug log warnings, adjust verbosity level
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34165
diff changeset
84 ui_name = ui_info ? g_hash_table_lookup(ui_info, "name") : NULL;
0f1f0b8c84f8 Fix some debug log warnings, adjust verbosity level
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34165
diff changeset
85 ui_version = ui_info ? g_hash_table_lookup(ui_info, "version") : NULL;
0f1f0b8c84f8 Fix some debug log warnings, adjust verbosity level
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34165
diff changeset
86
0f1f0b8c84f8 Fix some debug log warnings, adjust verbosity level
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34165
diff changeset
87 if (ui_name) {
0f1f0b8c84f8 Fix some debug log warnings, adjust verbosity level
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34165
diff changeset
88 ui_full_name = g_strdup_printf("%s%s%s", ui_name,
0f1f0b8c84f8 Fix some debug log warnings, adjust verbosity level
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34165
diff changeset
89 ui_version ? " " : "", ui_version);
0f1f0b8c84f8 Fix some debug log warnings, adjust verbosity level
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34165
diff changeset
90 }
0f1f0b8c84f8 Fix some debug log warnings, adjust verbosity level
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34165
diff changeset
91
0f1f0b8c84f8 Fix some debug log warnings, adjust verbosity level
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34165
diff changeset
92 purple_debug_info("main", "Launching %s%slibpurple %s",
0f1f0b8c84f8 Fix some debug log warnings, adjust verbosity level
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34165
diff changeset
93 ui_full_name ? ui_full_name : "",
0f1f0b8c84f8 Fix some debug log warnings, adjust verbosity level
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34165
diff changeset
94 ui_full_name ? " with " : "",
0f1f0b8c84f8 Fix some debug log warnings, adjust verbosity level
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34165
diff changeset
95 purple_core_get_version());
0f1f0b8c84f8 Fix some debug log warnings, adjust verbosity level
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34165
diff changeset
96
0f1f0b8c84f8 Fix some debug log warnings, adjust verbosity level
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34165
diff changeset
97 }
0f1f0b8c84f8 Fix some debug log warnings, adjust verbosity level
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34165
diff changeset
98
6179
4df73df94250 [gaim-migrate @ 6664]
Christian Hammond <chipx86@chipx86.com>
parents: 6168
diff changeset
99 gboolean
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15678
diff changeset
100 purple_core_init(const char *ui)
6179
4df73df94250 [gaim-migrate @ 6664]
Christian Hammond <chipx86@chipx86.com>
parents: 6168
diff changeset
101 {
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15678
diff changeset
102 PurpleCoreUiOps *ops;
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15678
diff changeset
103 PurpleCore *core;
6179
4df73df94250 [gaim-migrate @ 6664]
Christian Hammond <chipx86@chipx86.com>
parents: 6168
diff changeset
104
4df73df94250 [gaim-migrate @ 6664]
Christian Hammond <chipx86@chipx86.com>
parents: 6168
diff changeset
105 g_return_val_if_fail(ui != NULL, FALSE);
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15678
diff changeset
106 g_return_val_if_fail(purple_get_core() == NULL, FALSE);
6179
4df73df94250 [gaim-migrate @ 6664]
Christian Hammond <chipx86@chipx86.com>
parents: 6168
diff changeset
107
16124
8e5e3e9ada60 Hopefully prevent libpurple causing problems for 3rd party UIs if they also
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 15884
diff changeset
108 #ifdef ENABLE_NLS
8e5e3e9ada60 Hopefully prevent libpurple causing problems for 3rd party UIs if they also
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 15884
diff changeset
109 bindtextdomain(PACKAGE, LOCALEDIR);
8e5e3e9ada60 Hopefully prevent libpurple causing problems for 3rd party UIs if they also
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 15884
diff changeset
110 #endif
14286
9ff15ceacd34 [gaim-migrate @ 16905]
Daniel Atallah <datallah@pidgin.im>
parents: 14254
diff changeset
111 #ifdef _WIN32
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15678
diff changeset
112 wpurple_init();
14286
9ff15ceacd34 [gaim-migrate @ 16905]
Daniel Atallah <datallah@pidgin.im>
parents: 14254
diff changeset
113 #endif
9ff15ceacd34 [gaim-migrate @ 16905]
Daniel Atallah <datallah@pidgin.im>
parents: 14254
diff changeset
114
33890
4a1b14508788 Correctly remove deprecated functions g_type_init and g_thread_init
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 33882
diff changeset
115 #if !GLIB_CHECK_VERSION(2, 36, 0)
4a1b14508788 Correctly remove deprecated functions g_type_init and g_thread_init
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 33882
diff changeset
116 /* GLib type system is automaticaly initialized since 2.36. */
23138
ca068248eb99 Initialize the glib type system early in purple_core_init() too so UIs
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22873
diff changeset
117 g_type_init();
33890
4a1b14508788 Correctly remove deprecated functions g_type_init and g_thread_init
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 33882
diff changeset
118 #endif
23138
ca068248eb99 Initialize the glib type system early in purple_core_init() too so UIs
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22873
diff changeset
119
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15678
diff changeset
120 _core = core = g_new0(PurpleCore, 1);
6179
4df73df94250 [gaim-migrate @ 6664]
Christian Hammond <chipx86@chipx86.com>
parents: 6168
diff changeset
121 core->ui = g_strdup(ui);
4df73df94250 [gaim-migrate @ 6664]
Christian Hammond <chipx86@chipx86.com>
parents: 6168
diff changeset
122 core->reserved = NULL;
4df73df94250 [gaim-migrate @ 6664]
Christian Hammond <chipx86@chipx86.com>
parents: 6168
diff changeset
123
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15678
diff changeset
124 ops = purple_core_get_ui_ops();
6179
4df73df94250 [gaim-migrate @ 6664]
Christian Hammond <chipx86@chipx86.com>
parents: 6168
diff changeset
125
6485
3c7ba18e32f1 [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents: 6371
diff changeset
126 /* The signals subsystem is important and should be first. */
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15678
diff changeset
127 purple_signals_init();
6485
3c7ba18e32f1 [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents: 6371
diff changeset
128
21238
cd326828c870 Add and call a purple_util_uninit() to free user_dir and customer_home_dir
Richard Laager <rlaager@pidgin.im>
parents: 20147
diff changeset
129 purple_util_init();
cd326828c870 Add and call a purple_util_uninit() to free user_dir and customer_home_dir
Richard Laager <rlaager@pidgin.im>
parents: 20147
diff changeset
130
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15678
diff changeset
131 purple_signal_register(core, "uri-handler",
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15678
diff changeset
132 purple_marshal_BOOLEAN__POINTER_POINTER_POINTER,
34818
a65e961e1e29 Refactored core, ft, imgstore to use GType instead of PurpleValue
Ankit Vani <a@nevitus.org>
parents: 34583
diff changeset
133 G_TYPE_BOOLEAN, 3,
a65e961e1e29 Refactored core, ft, imgstore to use GType instead of PurpleValue
Ankit Vani <a@nevitus.org>
parents: 34583
diff changeset
134 G_TYPE_STRING, /* Protocol */
a65e961e1e29 Refactored core, ft, imgstore to use GType instead of PurpleValue
Ankit Vani <a@nevitus.org>
parents: 34583
diff changeset
135 G_TYPE_STRING, /* Command */
a65e961e1e29 Refactored core, ft, imgstore to use GType instead of PurpleValue
Ankit Vani <a@nevitus.org>
parents: 34583
diff changeset
136 G_TYPE_POINTER); /* Parameters (GHashTable *) */
15678
7434ef155a3a Core support for external protocol URIs. The actual handling of the URIs will be in the prpls and other plugins. This commit only includes the win32 method of actually passing in a URI - the dbus implementation still needs to be written.
Daniel Atallah <datallah@pidgin.im>
parents: 15435
diff changeset
137
34818
a65e961e1e29 Refactored core, ft, imgstore to use GType instead of PurpleValue
Ankit Vani <a@nevitus.org>
parents: 34583
diff changeset
138 purple_signal_register(core, "quitting", purple_marshal_VOID, G_TYPE_NONE,
a65e961e1e29 Refactored core, ft, imgstore to use GType instead of PurpleValue
Ankit Vani <a@nevitus.org>
parents: 34583
diff changeset
139 0);
a65e961e1e29 Refactored core, ft, imgstore to use GType instead of PurpleValue
Ankit Vani <a@nevitus.org>
parents: 34583
diff changeset
140 purple_signal_register(core, "core-initialized", purple_marshal_VOID,
a65e961e1e29 Refactored core, ft, imgstore to use GType instead of PurpleValue
Ankit Vani <a@nevitus.org>
parents: 34583
diff changeset
141 G_TYPE_NONE, 0);
6485
3c7ba18e32f1 [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents: 6371
diff changeset
142
34297
0f1f0b8c84f8 Fix some debug log warnings, adjust verbosity level
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34165
diff changeset
143 purple_core_print_version();
0f1f0b8c84f8 Fix some debug log warnings, adjust verbosity level
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34165
diff changeset
144
10087
e5b80a38939d [gaim-migrate @ 11098]
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 9944
diff changeset
145 /* The prefs subsystem needs to be initialized before static protocols
e5b80a38939d [gaim-migrate @ 11098]
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 9944
diff changeset
146 * for protocol prefs to work. */
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15678
diff changeset
147 purple_prefs_init();
10087
e5b80a38939d [gaim-migrate @ 11098]
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 9944
diff changeset
148
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15678
diff changeset
149 purple_debug_init();
10448
4415ffba12e9 [gaim-migrate @ 11713]
Mark Doliner <markdoliner@pidgin.im>
parents: 10418
diff changeset
150
9944
71ef020ec4b0 [gaim-migrate @ 10838]
Christian Hammond <chipx86@chipx86.com>
parents: 9649
diff changeset
151 if (ops != NULL)
71ef020ec4b0 [gaim-migrate @ 10838]
Christian Hammond <chipx86@chipx86.com>
parents: 9649
diff changeset
152 {
6179
4df73df94250 [gaim-migrate @ 6664]
Christian Hammond <chipx86@chipx86.com>
parents: 6168
diff changeset
153 if (ops->ui_prefs_init != NULL)
4df73df94250 [gaim-migrate @ 6664]
Christian Hammond <chipx86@chipx86.com>
parents: 6168
diff changeset
154 ops->ui_prefs_init();
4df73df94250 [gaim-migrate @ 6664]
Christian Hammond <chipx86@chipx86.com>
parents: 6168
diff changeset
155
4df73df94250 [gaim-migrate @ 6664]
Christian Hammond <chipx86@chipx86.com>
parents: 6168
diff changeset
156 if (ops->debug_ui_init != NULL)
4df73df94250 [gaim-migrate @ 6664]
Christian Hammond <chipx86@chipx86.com>
parents: 6168
diff changeset
157 ops->debug_ui_init();
4df73df94250 [gaim-migrate @ 6664]
Christian Hammond <chipx86@chipx86.com>
parents: 6168
diff changeset
158 }
4df73df94250 [gaim-migrate @ 6664]
Christian Hammond <chipx86@chipx86.com>
parents: 6168
diff changeset
159
11171
a25653d60f9c [gaim-migrate @ 13272]
Piotr Zielinski <zielaj@users.sourceforge.net>
parents: 11033
diff changeset
160 #ifdef HAVE_DBUS
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15678
diff changeset
161 purple_dbus_init();
11171
a25653d60f9c [gaim-migrate @ 13272]
Piotr Zielinski <zielaj@users.sourceforge.net>
parents: 11033
diff changeset
162 #endif
a25653d60f9c [gaim-migrate @ 13272]
Piotr Zielinski <zielaj@users.sourceforge.net>
parents: 11033
diff changeset
163
23847
a4260c372f4c Initialize the commands subsystem before the plugins.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 23555
diff changeset
164 purple_cmds_init();
16660
05ee74f25b2a Part of the patch in ticket #383:
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 16608
diff changeset
165
11033
dc68e074f10d [gaim-migrate @ 12919]
Etan Reisner <deryni@pidgin.im>
parents: 10684
diff changeset
166 /* Since plugins get probed so early we should probably initialize their
dc68e074f10d [gaim-migrate @ 12919]
Etan Reisner <deryni@pidgin.im>
parents: 10684
diff changeset
167 * subsystem right away too.
dc68e074f10d [gaim-migrate @ 12919]
Etan Reisner <deryni@pidgin.im>
parents: 10684
diff changeset
168 */
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15678
diff changeset
169 purple_plugins_init();
25339
1ccd84242080 disapproval of revision '72679a30e1cb464d1dc7c74b14b848c3a51538ca'
Daniel Atallah <datallah@pidgin.im>
parents: 25338
diff changeset
170
23345
aae374ed980c If plugins are enabled and some protocols or plugins are also being compiled
Evan Schoenberg <evands@pidgin.im>
parents: 23339
diff changeset
171 /* Initialize all static protocols. */
aae374ed980c If plugins are enabled and some protocols or plugins are also being compiled
Evan Schoenberg <evands@pidgin.im>
parents: 23339
diff changeset
172 static_proto_init();
aae374ed980c If plugins are enabled and some protocols or plugins are also being compiled
Evan Schoenberg <evands@pidgin.im>
parents: 23339
diff changeset
173
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15678
diff changeset
174 purple_plugins_probe(G_MODULE_SUFFIX);
11033
dc68e074f10d [gaim-migrate @ 12919]
Etan Reisner <deryni@pidgin.im>
parents: 10684
diff changeset
175
34165
cdd4b0dfe92b keyring.c refactoring: use signal instead of hack depending on implementation
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34148
diff changeset
176 purple_keyring_init(); /* before accounts */
23655
704a67a69ce0 Changed the theme_manager_init function to do less, makes it cleaner and faster (won't have to build
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23647
diff changeset
177 purple_theme_manager_init();
25884
c00e14c20165 * Alphabetize files in a few Makefile.am files
Mark Doliner <markdoliner@pidgin.im>
parents: 25871
diff changeset
178
16437
7ff7c3405ea2 Rework the buddy icon subsystem to use the imgstore subsystem, and modify the
Richard Laager <rlaager@pidgin.im>
parents: 16409
diff changeset
179 /* The buddy icon code uses the imgstore, so init it early. */
7ff7c3405ea2 Rework the buddy icon subsystem to use the imgstore subsystem, and modify the
Richard Laager <rlaager@pidgin.im>
parents: 16409
diff changeset
180 purple_imgstore_init();
7ff7c3405ea2 Rework the buddy icon subsystem to use the imgstore subsystem, and modify the
Richard Laager <rlaager@pidgin.im>
parents: 16409
diff changeset
181
21292
076fbf488504 Connect to connection-error in account.c so that the account error is actually
Will Thompson <resiak@pidgin.im>
parents: 21238
diff changeset
182 /* Accounts use status, buddy icons and connection signals, so
076fbf488504 Connect to connection-error in account.c so that the account error is actually
Will Thompson <resiak@pidgin.im>
parents: 21238
diff changeset
183 * initialize these before accounts
076fbf488504 Connect to connection-error in account.c so that the account error is actually
Will Thompson <resiak@pidgin.im>
parents: 21238
diff changeset
184 */
34855
9c289149eed4 Global replaces according to GObject status API
Ankit Vani <a@nevitus.org>
parents: 34818
diff changeset
185 purple_statuses_init();
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15678
diff changeset
186 purple_buddy_icons_init();
21292
076fbf488504 Connect to connection-error in account.c so that the account error is actually
Will Thompson <resiak@pidgin.im>
parents: 21238
diff changeset
187 purple_connections_init();
13481
6a4badb9f8e4 [gaim-migrate @ 15856]
Evan Schoenberg <evands@pidgin.im>
parents: 13294
diff changeset
188
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15678
diff changeset
189 purple_accounts_init();
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15678
diff changeset
190 purple_savedstatuses_init();
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15678
diff changeset
191 purple_notify_init();
18477
47243c0d52c6 - Certificate system now has init and uninit like other systems
William Ehlhardt <williamehlhardt@gmail.com>
parents: 18303
diff changeset
192 purple_certificate_init();
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15678
diff changeset
193 purple_conversations_init();
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15678
diff changeset
194 purple_blist_init();
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15678
diff changeset
195 purple_log_init();
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15678
diff changeset
196 purple_network_init();
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15678
diff changeset
197 purple_pounces_init();
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15678
diff changeset
198 purple_proxy_init();
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15678
diff changeset
199 purple_dnsquery_init();
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15678
diff changeset
200 purple_sound_init();
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15678
diff changeset
201 purple_ssl_init();
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15678
diff changeset
202 purple_stun_init();
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15678
diff changeset
203 purple_xfers_init();
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15678
diff changeset
204 purple_idle_init();
33439
178eb69a3f11 Handle redirects
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 31590
diff changeset
205 purple_http_init();
35776
901a94245460 Comments: custom smileys
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 35715
diff changeset
206 _purple_smiley_custom_init();
35715
2aa79f05247e Custom smileys storage
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 35703
diff changeset
207
15116
037b787407ba [gaim-migrate @ 17838]
Mark Doliner <markdoliner@pidgin.im>
parents: 14300
diff changeset
208 /*
037b787407ba [gaim-migrate @ 17838]
Mark Doliner <markdoliner@pidgin.im>
parents: 14300
diff changeset
209 * Call this early on to try to auto-detect our IP address and
037b787407ba [gaim-migrate @ 17838]
Mark Doliner <markdoliner@pidgin.im>
parents: 14300
diff changeset
210 * hopefully save some time later.
037b787407ba [gaim-migrate @ 17838]
Mark Doliner <markdoliner@pidgin.im>
parents: 14300
diff changeset
211 */
19675
3c1669c529a1 Move purple_prefs_load() to purple_prefs_init() - there's been a TODO for this for a long time. I have no idea why this wasn't done sooner; it seems to work just fine and fixes some bugs where stuff isn't loaded before being used. Fixes #1848 (and I'm sure others). Yell at me if this breaks anything.
Daniel Atallah <datallah@pidgin.im>
parents: 19341
diff changeset
212 purple_network_get_my_ip(-1);
13181
2a22fe4717ed [gaim-migrate @ 15543]
Daniel Atallah <datallah@pidgin.im>
parents: 13130
diff changeset
213
6179
4df73df94250 [gaim-migrate @ 6664]
Christian Hammond <chipx86@chipx86.com>
parents: 6168
diff changeset
214 if (ops != NULL && ops->ui_init != NULL)
4df73df94250 [gaim-migrate @ 6664]
Christian Hammond <chipx86@chipx86.com>
parents: 6168
diff changeset
215 ops->ui_init();
4df73df94250 [gaim-migrate @ 6664]
Christian Hammond <chipx86@chipx86.com>
parents: 6168
diff changeset
216
25862
57228df2541f Fix the issue with the themes not showing up in the list.
Paul Aurich <darkrain42@pidgin.im>
parents: 25859
diff changeset
217 /* The UI may have registered some theme types, so refresh them */
57228df2541f Fix the issue with the themes not showing up in the list.
Paul Aurich <darkrain42@pidgin.im>
parents: 25859
diff changeset
218 purple_theme_manager_refresh();
57228df2541f Fix the issue with the themes not showing up in the list.
Paul Aurich <darkrain42@pidgin.im>
parents: 25859
diff changeset
219
33643
6f7deddb8850 Move blist loading into purple_core_init.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33538
diff changeset
220 /* Load the buddy list after UI init */
6f7deddb8850 Move blist loading into purple_core_init.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33538
diff changeset
221 purple_blist_boot();
6f7deddb8850 Move blist loading into purple_core_init.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33538
diff changeset
222
34127
51c1bce7f52f Tidying debug messages, signals
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34125
diff changeset
223 purple_signal_emit(purple_get_core(), "core-initialized");
51c1bce7f52f Tidying debug messages, signals
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34125
diff changeset
224
6179
4df73df94250 [gaim-migrate @ 6664]
Christian Hammond <chipx86@chipx86.com>
parents: 6168
diff changeset
225 return TRUE;
4df73df94250 [gaim-migrate @ 6664]
Christian Hammond <chipx86@chipx86.com>
parents: 6168
diff changeset
226 }
4df73df94250 [gaim-migrate @ 6664]
Christian Hammond <chipx86@chipx86.com>
parents: 6168
diff changeset
227
4df73df94250 [gaim-migrate @ 6664]
Christian Hammond <chipx86@chipx86.com>
parents: 6168
diff changeset
228 void
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15678
diff changeset
229 purple_core_quit(void)
6179
4df73df94250 [gaim-migrate @ 6664]
Christian Hammond <chipx86@chipx86.com>
parents: 6168
diff changeset
230 {
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15678
diff changeset
231 PurpleCoreUiOps *ops;
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15678
diff changeset
232 PurpleCore *core = purple_get_core();
6179
4df73df94250 [gaim-migrate @ 6664]
Christian Hammond <chipx86@chipx86.com>
parents: 6168
diff changeset
233
4df73df94250 [gaim-migrate @ 6664]
Christian Hammond <chipx86@chipx86.com>
parents: 6168
diff changeset
234 g_return_if_fail(core != NULL);
4df73df94250 [gaim-migrate @ 6664]
Christian Hammond <chipx86@chipx86.com>
parents: 6168
diff changeset
235
4df73df94250 [gaim-migrate @ 6664]
Christian Hammond <chipx86@chipx86.com>
parents: 6168
diff changeset
236 /* The self destruct sequence has been initiated */
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15678
diff changeset
237 purple_signal_emit(purple_get_core(), "quitting");
6179
4df73df94250 [gaim-migrate @ 6664]
Christian Hammond <chipx86@chipx86.com>
parents: 6168
diff changeset
238
4df73df94250 [gaim-migrate @ 6664]
Christian Hammond <chipx86@chipx86.com>
parents: 6168
diff changeset
239 /* Transmission ends */
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15678
diff changeset
240 purple_connections_disconnect_all();
6179
4df73df94250 [gaim-migrate @ 6664]
Christian Hammond <chipx86@chipx86.com>
parents: 6168
diff changeset
241
25467
9631ed4f4527 Fix a crash on exit with a patch from im.pidgin.next.minor.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 25449
diff changeset
242 /*
9631ed4f4527 Fix a crash on exit with a patch from im.pidgin.next.minor.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 25449
diff changeset
243 * Certificates must be destroyed before the SSL plugins, because
9631ed4f4527 Fix a crash on exit with a patch from im.pidgin.next.minor.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 25449
diff changeset
244 * PurpleCertificates contain pointers to PurpleCertificateSchemes,
9631ed4f4527 Fix a crash on exit with a patch from im.pidgin.next.minor.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 25449
diff changeset
245 * and the PurpleCertificateSchemes will be unregistered when the
9631ed4f4527 Fix a crash on exit with a patch from im.pidgin.next.minor.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 25449
diff changeset
246 * SSL plugin is uninit.
9631ed4f4527 Fix a crash on exit with a patch from im.pidgin.next.minor.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 25449
diff changeset
247 */
9631ed4f4527 Fix a crash on exit with a patch from im.pidgin.next.minor.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 25449
diff changeset
248 purple_certificate_uninit();
9631ed4f4527 Fix a crash on exit with a patch from im.pidgin.next.minor.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 25449
diff changeset
249
25446
4d2288e37f38 Reorder (and document) purple_core_quit() so that the prefs_uninit() fixes can
Paul Aurich <darkrain42@pidgin.im>
parents: 25338
diff changeset
250 /* The SSL plugins must be uninit before they're unloaded */
4d2288e37f38 Reorder (and document) purple_core_quit() so that the prefs_uninit() fixes can
Paul Aurich <darkrain42@pidgin.im>
parents: 25338
diff changeset
251 purple_ssl_uninit();
4d2288e37f38 Reorder (and document) purple_core_quit() so that the prefs_uninit() fixes can
Paul Aurich <darkrain42@pidgin.im>
parents: 25338
diff changeset
252
26751
4b0dffa16ffe Apply patch from darkrain42 to fix the crash-on-exit. Hopefully, the order
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 26743
diff changeset
253 /* Unload all non-loader, non-prpl plugins before shutting down
4b0dffa16ffe Apply patch from darkrain42 to fix the crash-on-exit. Hopefully, the order
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 26743
diff changeset
254 * subsystems. */
4b0dffa16ffe Apply patch from darkrain42 to fix the crash-on-exit. Hopefully, the order
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 26743
diff changeset
255 purple_debug_info("main", "Unloading normal plugins\n");
4b0dffa16ffe Apply patch from darkrain42 to fix the crash-on-exit. Hopefully, the order
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 26743
diff changeset
256 purple_plugins_unload(PURPLE_PLUGIN_STANDARD);
25446
4d2288e37f38 Reorder (and document) purple_core_quit() so that the prefs_uninit() fixes can
Paul Aurich <darkrain42@pidgin.im>
parents: 25338
diff changeset
257
8235
00045afab151 [gaim-migrate @ 8958]
Gary Kramlich <grim@pidgin.im>
parents: 8231
diff changeset
258 /* Save .xml files, remove signals, etc. */
35778
8ea15abd8688 Comments: PurpleSmileyTheme
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 35776
diff changeset
259 _purple_smiley_theme_uninit();
35776
901a94245460 Comments: custom smileys
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 35715
diff changeset
260 _purple_smiley_custom_uninit();
33439
178eb69a3f11 Handle redirects
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 31590
diff changeset
261 purple_http_uninit();
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15678
diff changeset
262 purple_idle_uninit();
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15678
diff changeset
263 purple_pounces_uninit();
35131
6cf8a9b09ba1 Fix glib warnings on quit, where conversation destruction needs the buddy list alive
Ankit Vani <a@nevitus.org>
parents: 34910
diff changeset
264 purple_conversations_uninit();
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15678
diff changeset
265 purple_blist_uninit();
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15678
diff changeset
266 purple_notify_uninit();
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15678
diff changeset
267 purple_connections_uninit();
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15678
diff changeset
268 purple_buddy_icons_uninit();
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15678
diff changeset
269 purple_savedstatuses_uninit();
34855
9c289149eed4 Global replaces according to GObject status API
Ankit Vani <a@nevitus.org>
parents: 34818
diff changeset
270 purple_statuses_uninit();
26896
fd3f89b3af4e don't uninit accounts until savedstatus and status are uninited, this was
Ka-Hing Cheung <khc@pidgin.im>
parents: 26751
diff changeset
271 purple_accounts_uninit();
34127
51c1bce7f52f Tidying debug messages, signals
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34125
diff changeset
272 purple_keyring_uninit(); /* after accounts */
23339
ccda14e05414 Revert f8871b9c186682ffab8d6b6aa32260788caf0653 to fix a TODO about calling
Richard Laager <rlaager@pidgin.im>
parents: 23302
diff changeset
273 purple_sound_uninit();
23645
6901039a86fb Fixed purple sound loader class init function (bug on startup) and added shell sound theme selector
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23345
diff changeset
274 purple_theme_manager_uninit();
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15678
diff changeset
275 purple_xfers_uninit();
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15678
diff changeset
276 purple_proxy_uninit();
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15678
diff changeset
277 purple_dnsquery_uninit();
16437
7ff7c3405ea2 Rework the buddy icon subsystem to use the imgstore subsystem, and modify the
Richard Laager <rlaager@pidgin.im>
parents: 16409
diff changeset
278 purple_imgstore_uninit();
25326
c4f4b222dbac Adjust the NLA code to prevent hang on exit for Windows XP and Windows Vista.
Paul Aurich <darkrain42@pidgin.im>
parents: 24389
diff changeset
279 purple_network_uninit();
6485
3c7ba18e32f1 [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents: 6371
diff changeset
280
26751
4b0dffa16ffe Apply patch from darkrain42 to fix the crash-on-exit. Hopefully, the order
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 26743
diff changeset
281 /* Everything after unloading all plugins must not fail if prpls aren't
4b0dffa16ffe Apply patch from darkrain42 to fix the crash-on-exit. Hopefully, the order
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 26743
diff changeset
282 * around */
25713
9dc831db9cce Alternate, API-safe fix for #8774 (crash on exit)
Ethan Blanton <elb@pidgin.im>
parents: 25712
diff changeset
283 purple_debug_info("main", "Unloading all plugins\n");
9dc831db9cce Alternate, API-safe fix for #8774 (crash on exit)
Ethan Blanton <elb@pidgin.im>
parents: 25712
diff changeset
284 purple_plugins_destroy_all();
9dc831db9cce Alternate, API-safe fix for #8774 (crash on exit)
Ethan Blanton <elb@pidgin.im>
parents: 25712
diff changeset
285
9dc831db9cce Alternate, API-safe fix for #8774 (crash on exit)
Ethan Blanton <elb@pidgin.im>
parents: 25712
diff changeset
286 ops = purple_core_get_ui_ops();
9dc831db9cce Alternate, API-safe fix for #8774 (crash on exit)
Ethan Blanton <elb@pidgin.im>
parents: 25712
diff changeset
287 if (ops != NULL && ops->quit != NULL)
9dc831db9cce Alternate, API-safe fix for #8774 (crash on exit)
Ethan Blanton <elb@pidgin.im>
parents: 25712
diff changeset
288 ops->quit();
9dc831db9cce Alternate, API-safe fix for #8774 (crash on exit)
Ethan Blanton <elb@pidgin.im>
parents: 25712
diff changeset
289
26751
4b0dffa16ffe Apply patch from darkrain42 to fix the crash-on-exit. Hopefully, the order
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 26743
diff changeset
290 /* Everything after prefs_uninit must not try to read any prefs */
25446
4d2288e37f38 Reorder (and document) purple_core_quit() so that the prefs_uninit() fixes can
Paul Aurich <darkrain42@pidgin.im>
parents: 25338
diff changeset
291 purple_prefs_uninit();
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15678
diff changeset
292 purple_plugins_uninit();
14017
db3f1bdc95c6 [gaim-migrate @ 16503]
Mark Doliner <markdoliner@pidgin.im>
parents: 13481
diff changeset
293 #ifdef HAVE_DBUS
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15678
diff changeset
294 purple_dbus_uninit();
14017
db3f1bdc95c6 [gaim-migrate @ 16503]
Mark Doliner <markdoliner@pidgin.im>
parents: 13481
diff changeset
295 #endif
21238
cd326828c870 Add and call a purple_util_uninit() to free user_dir and customer_home_dir
Richard Laager <rlaager@pidgin.im>
parents: 20147
diff changeset
296
23847
a4260c372f4c Initialize the commands subsystem before the plugins.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 23555
diff changeset
297 purple_cmds_uninit();
33538
cbeb76707f12 Better implementation of purple_escape_js
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 33439
diff changeset
298 purple_log_uninit();
cbeb76707f12 Better implementation of purple_escape_js
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 33439
diff changeset
299 /* Everything after util_uninit cannot try to write things to the
cbeb76707f12 Better implementation of purple_escape_js
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 33439
diff changeset
300 * confdir nor use purple_escape_js
cbeb76707f12 Better implementation of purple_escape_js
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 33439
diff changeset
301 */
21238
cd326828c870 Add and call a purple_util_uninit() to free user_dir and customer_home_dir
Richard Laager <rlaager@pidgin.im>
parents: 20147
diff changeset
302 purple_util_uninit();
cd326828c870 Add and call a purple_util_uninit() to free user_dir and customer_home_dir
Richard Laager <rlaager@pidgin.im>
parents: 20147
diff changeset
303
18303
5cc245e1fcf3 Uninit the dbus system before uniniting the signals.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 18267
diff changeset
304 purple_signals_uninit();
14017
db3f1bdc95c6 [gaim-migrate @ 16503]
Mark Doliner <markdoliner@pidgin.im>
parents: 13481
diff changeset
305
14097
0c340861ab79 [gaim-migrate @ 16638]
Mark Doliner <markdoliner@pidgin.im>
parents: 14017
diff changeset
306 g_free(core->ui);
6179
4df73df94250 [gaim-migrate @ 6664]
Christian Hammond <chipx86@chipx86.com>
parents: 6168
diff changeset
307 g_free(core);
4df73df94250 [gaim-migrate @ 6664]
Christian Hammond <chipx86@chipx86.com>
parents: 6168
diff changeset
308
14286
9ff15ceacd34 [gaim-migrate @ 16905]
Daniel Atallah <datallah@pidgin.im>
parents: 14254
diff changeset
309 #ifdef _WIN32
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15678
diff changeset
310 wpurple_cleanup();
14286
9ff15ceacd34 [gaim-migrate @ 16905]
Daniel Atallah <datallah@pidgin.im>
parents: 14254
diff changeset
311 #endif
9ff15ceacd34 [gaim-migrate @ 16905]
Daniel Atallah <datallah@pidgin.im>
parents: 14254
diff changeset
312
6179
4df73df94250 [gaim-migrate @ 6664]
Christian Hammond <chipx86@chipx86.com>
parents: 6168
diff changeset
313 _core = NULL;
4df73df94250 [gaim-migrate @ 6664]
Christian Hammond <chipx86@chipx86.com>
parents: 6168
diff changeset
314 }
4df73df94250 [gaim-migrate @ 6664]
Christian Hammond <chipx86@chipx86.com>
parents: 6168
diff changeset
315
7646
6806a6893ac0 [gaim-migrate @ 8289]
Mark Doliner <markdoliner@pidgin.im>
parents: 7431
diff changeset
316 gboolean
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15678
diff changeset
317 purple_core_quit_cb(gpointer unused)
7646
6806a6893ac0 [gaim-migrate @ 8289]
Mark Doliner <markdoliner@pidgin.im>
parents: 7431
diff changeset
318 {
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15678
diff changeset
319 purple_core_quit();
7646
6806a6893ac0 [gaim-migrate @ 8289]
Mark Doliner <markdoliner@pidgin.im>
parents: 7431
diff changeset
320
6806a6893ac0 [gaim-migrate @ 8289]
Mark Doliner <markdoliner@pidgin.im>
parents: 7431
diff changeset
321 return FALSE;
6806a6893ac0 [gaim-migrate @ 8289]
Mark Doliner <markdoliner@pidgin.im>
parents: 7431
diff changeset
322 }
6806a6893ac0 [gaim-migrate @ 8289]
Mark Doliner <markdoliner@pidgin.im>
parents: 7431
diff changeset
323
6612
aac6af649208 [gaim-migrate @ 7136]
Christian Hammond <chipx86@chipx86.com>
parents: 6564
diff changeset
324 const char *
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15678
diff changeset
325 purple_core_get_version(void)
6612
aac6af649208 [gaim-migrate @ 7136]
Christian Hammond <chipx86@chipx86.com>
parents: 6564
diff changeset
326 {
aac6af649208 [gaim-migrate @ 7136]
Christian Hammond <chipx86@chipx86.com>
parents: 6564
diff changeset
327 return VERSION;
aac6af649208 [gaim-migrate @ 7136]
Christian Hammond <chipx86@chipx86.com>
parents: 6564
diff changeset
328 }
aac6af649208 [gaim-migrate @ 7136]
Christian Hammond <chipx86@chipx86.com>
parents: 6564
diff changeset
329
6179
4df73df94250 [gaim-migrate @ 6664]
Christian Hammond <chipx86@chipx86.com>
parents: 6168
diff changeset
330 const char *
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15678
diff changeset
331 purple_core_get_ui(void)
6179
4df73df94250 [gaim-migrate @ 6664]
Christian Hammond <chipx86@chipx86.com>
parents: 6168
diff changeset
332 {
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15678
diff changeset
333 PurpleCore *core = purple_get_core();
6179
4df73df94250 [gaim-migrate @ 6664]
Christian Hammond <chipx86@chipx86.com>
parents: 6168
diff changeset
334
4df73df94250 [gaim-migrate @ 6664]
Christian Hammond <chipx86@chipx86.com>
parents: 6168
diff changeset
335 g_return_val_if_fail(core != NULL, NULL);
4df73df94250 [gaim-migrate @ 6664]
Christian Hammond <chipx86@chipx86.com>
parents: 6168
diff changeset
336
4df73df94250 [gaim-migrate @ 6664]
Christian Hammond <chipx86@chipx86.com>
parents: 6168
diff changeset
337 return core->ui;
4df73df94250 [gaim-migrate @ 6664]
Christian Hammond <chipx86@chipx86.com>
parents: 6168
diff changeset
338 }
4df73df94250 [gaim-migrate @ 6664]
Christian Hammond <chipx86@chipx86.com>
parents: 6168
diff changeset
339
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15678
diff changeset
340 PurpleCore *
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15678
diff changeset
341 purple_get_core(void)
6179
4df73df94250 [gaim-migrate @ 6664]
Christian Hammond <chipx86@chipx86.com>
parents: 6168
diff changeset
342 {
4df73df94250 [gaim-migrate @ 6664]
Christian Hammond <chipx86@chipx86.com>
parents: 6168
diff changeset
343 return _core;
4df73df94250 [gaim-migrate @ 6664]
Christian Hammond <chipx86@chipx86.com>
parents: 6168
diff changeset
344 }
4df73df94250 [gaim-migrate @ 6664]
Christian Hammond <chipx86@chipx86.com>
parents: 6168
diff changeset
345
35572
5c4846317f2f Box the *UiOps structures
Ankit Vani <a@nevitus.org>
parents: 35499
diff changeset
346 static PurpleCoreUiOps *
5c4846317f2f Box the *UiOps structures
Ankit Vani <a@nevitus.org>
parents: 35499
diff changeset
347 purple_core_ui_ops_copy(PurpleCoreUiOps *ops)
5c4846317f2f Box the *UiOps structures
Ankit Vani <a@nevitus.org>
parents: 35499
diff changeset
348 {
5c4846317f2f Box the *UiOps structures
Ankit Vani <a@nevitus.org>
parents: 35499
diff changeset
349 PurpleCoreUiOps *ops_new;
5c4846317f2f Box the *UiOps structures
Ankit Vani <a@nevitus.org>
parents: 35499
diff changeset
350
5c4846317f2f Box the *UiOps structures
Ankit Vani <a@nevitus.org>
parents: 35499
diff changeset
351 g_return_val_if_fail(ops != NULL, NULL);
5c4846317f2f Box the *UiOps structures
Ankit Vani <a@nevitus.org>
parents: 35499
diff changeset
352
5c4846317f2f Box the *UiOps structures
Ankit Vani <a@nevitus.org>
parents: 35499
diff changeset
353 ops_new = g_new(PurpleCoreUiOps, 1);
5c4846317f2f Box the *UiOps structures
Ankit Vani <a@nevitus.org>
parents: 35499
diff changeset
354 *ops_new = *ops;
5c4846317f2f Box the *UiOps structures
Ankit Vani <a@nevitus.org>
parents: 35499
diff changeset
355
5c4846317f2f Box the *UiOps structures
Ankit Vani <a@nevitus.org>
parents: 35499
diff changeset
356 return ops_new;
5c4846317f2f Box the *UiOps structures
Ankit Vani <a@nevitus.org>
parents: 35499
diff changeset
357 }
5c4846317f2f Box the *UiOps structures
Ankit Vani <a@nevitus.org>
parents: 35499
diff changeset
358
5c4846317f2f Box the *UiOps structures
Ankit Vani <a@nevitus.org>
parents: 35499
diff changeset
359 GType
5c4846317f2f Box the *UiOps structures
Ankit Vani <a@nevitus.org>
parents: 35499
diff changeset
360 purple_core_ui_ops_get_type(void)
5c4846317f2f Box the *UiOps structures
Ankit Vani <a@nevitus.org>
parents: 35499
diff changeset
361 {
5c4846317f2f Box the *UiOps structures
Ankit Vani <a@nevitus.org>
parents: 35499
diff changeset
362 static GType type = 0;
5c4846317f2f Box the *UiOps structures
Ankit Vani <a@nevitus.org>
parents: 35499
diff changeset
363
5c4846317f2f Box the *UiOps structures
Ankit Vani <a@nevitus.org>
parents: 35499
diff changeset
364 if (type == 0) {
5c4846317f2f Box the *UiOps structures
Ankit Vani <a@nevitus.org>
parents: 35499
diff changeset
365 type = g_boxed_type_register_static("PurpleCoreUiOps",
5c4846317f2f Box the *UiOps structures
Ankit Vani <a@nevitus.org>
parents: 35499
diff changeset
366 (GBoxedCopyFunc)purple_core_ui_ops_copy,
35597
7fcfcf147b99 Use g_free as UiOps structures GBoxed free function
Ankit Vani <a@nevitus.org>
parents: 35572
diff changeset
367 (GBoxedFreeFunc)g_free);
35572
5c4846317f2f Box the *UiOps structures
Ankit Vani <a@nevitus.org>
parents: 35499
diff changeset
368 }
5c4846317f2f Box the *UiOps structures
Ankit Vani <a@nevitus.org>
parents: 35499
diff changeset
369
5c4846317f2f Box the *UiOps structures
Ankit Vani <a@nevitus.org>
parents: 35499
diff changeset
370 return type;
5c4846317f2f Box the *UiOps structures
Ankit Vani <a@nevitus.org>
parents: 35499
diff changeset
371 }
5c4846317f2f Box the *UiOps structures
Ankit Vani <a@nevitus.org>
parents: 35499
diff changeset
372
6179
4df73df94250 [gaim-migrate @ 6664]
Christian Hammond <chipx86@chipx86.com>
parents: 6168
diff changeset
373 void
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15678
diff changeset
374 purple_core_set_ui_ops(PurpleCoreUiOps *ops)
6179
4df73df94250 [gaim-migrate @ 6664]
Christian Hammond <chipx86@chipx86.com>
parents: 6168
diff changeset
375 {
4df73df94250 [gaim-migrate @ 6664]
Christian Hammond <chipx86@chipx86.com>
parents: 6168
diff changeset
376 _ops = ops;
4df73df94250 [gaim-migrate @ 6664]
Christian Hammond <chipx86@chipx86.com>
parents: 6168
diff changeset
377 }
4df73df94250 [gaim-migrate @ 6664]
Christian Hammond <chipx86@chipx86.com>
parents: 6168
diff changeset
378
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15678
diff changeset
379 PurpleCoreUiOps *
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15678
diff changeset
380 purple_core_get_ui_ops(void)
6179
4df73df94250 [gaim-migrate @ 6664]
Christian Hammond <chipx86@chipx86.com>
parents: 6168
diff changeset
381 {
4df73df94250 [gaim-migrate @ 6664]
Christian Hammond <chipx86@chipx86.com>
parents: 6168
diff changeset
382 return _ops;
4df73df94250 [gaim-migrate @ 6664]
Christian Hammond <chipx86@chipx86.com>
parents: 6168
diff changeset
383 }
16409
8c153c6febdd The core portion of the migration code. This is implemented as I described
Richard Laager <rlaager@pidgin.im>
parents: 16124
diff changeset
384
17121
43d41f5ce17b Alternative dbus_uniq implementation
Gabriel Schulhof <nix@go-nix.ca>
parents: 16763
diff changeset
385 #ifdef HAVE_DBUS
43d41f5ce17b Alternative dbus_uniq implementation
Gabriel Schulhof <nix@go-nix.ca>
parents: 16763
diff changeset
386 static char *purple_dbus_owner_user_dir(void)
43d41f5ce17b Alternative dbus_uniq implementation
Gabriel Schulhof <nix@go-nix.ca>
parents: 16763
diff changeset
387 {
43d41f5ce17b Alternative dbus_uniq implementation
Gabriel Schulhof <nix@go-nix.ca>
parents: 16763
diff changeset
388 DBusMessage *msg = NULL, *reply = NULL;
43d41f5ce17b Alternative dbus_uniq implementation
Gabriel Schulhof <nix@go-nix.ca>
parents: 16763
diff changeset
389 DBusConnection *dbus_connection = NULL;
43d41f5ce17b Alternative dbus_uniq implementation
Gabriel Schulhof <nix@go-nix.ca>
parents: 16763
diff changeset
390 DBusError dbus_error;
43d41f5ce17b Alternative dbus_uniq implementation
Gabriel Schulhof <nix@go-nix.ca>
parents: 16763
diff changeset
391 char *remote_user_dir = NULL;
43d41f5ce17b Alternative dbus_uniq implementation
Gabriel Schulhof <nix@go-nix.ca>
parents: 16763
diff changeset
392
17122
5ba216aa4583 Style changes + removed unnecessary NULL checks.
Gabriel Schulhof <nix@go-nix.ca>
parents: 17121
diff changeset
393 if ((dbus_connection = purple_dbus_get_connection()) == NULL)
17121
43d41f5ce17b Alternative dbus_uniq implementation
Gabriel Schulhof <nix@go-nix.ca>
parents: 16763
diff changeset
394 return NULL;
43d41f5ce17b Alternative dbus_uniq implementation
Gabriel Schulhof <nix@go-nix.ca>
parents: 16763
diff changeset
395
35499
c4c5e0a670b1 Fix namespaces issues in libpurple.
Ankit Vani <a@nevitus.org>
parents: 35454
diff changeset
396 if ((msg = dbus_message_new_method_call(PURPLE_DBUS_SERVICE, PURPLE_DBUS_PATH, PURPLE_DBUS_INTERFACE, "PurpleUserDir")) == NULL)
17121
43d41f5ce17b Alternative dbus_uniq implementation
Gabriel Schulhof <nix@go-nix.ca>
parents: 16763
diff changeset
397 return NULL;
43d41f5ce17b Alternative dbus_uniq implementation
Gabriel Schulhof <nix@go-nix.ca>
parents: 16763
diff changeset
398
43d41f5ce17b Alternative dbus_uniq implementation
Gabriel Schulhof <nix@go-nix.ca>
parents: 16763
diff changeset
399 dbus_error_init(&dbus_error);
43d41f5ce17b Alternative dbus_uniq implementation
Gabriel Schulhof <nix@go-nix.ca>
parents: 16763
diff changeset
400 reply = dbus_connection_send_with_reply_and_block(dbus_connection, msg, 5000, &dbus_error);
43d41f5ce17b Alternative dbus_uniq implementation
Gabriel Schulhof <nix@go-nix.ca>
parents: 16763
diff changeset
401 dbus_message_unref(msg);
43d41f5ce17b Alternative dbus_uniq implementation
Gabriel Schulhof <nix@go-nix.ca>
parents: 16763
diff changeset
402 dbus_error_free(&dbus_error);
43d41f5ce17b Alternative dbus_uniq implementation
Gabriel Schulhof <nix@go-nix.ca>
parents: 16763
diff changeset
403
17882
35499bfa38fb Style changes.
Richard Laager <rlaager@pidgin.im>
parents: 17220
diff changeset
404 if (reply)
35499bfa38fb Style changes.
Richard Laager <rlaager@pidgin.im>
parents: 17220
diff changeset
405 {
17121
43d41f5ce17b Alternative dbus_uniq implementation
Gabriel Schulhof <nix@go-nix.ca>
parents: 16763
diff changeset
406 dbus_error_init(&dbus_error);
43d41f5ce17b Alternative dbus_uniq implementation
Gabriel Schulhof <nix@go-nix.ca>
parents: 16763
diff changeset
407 dbus_message_get_args(reply, &dbus_error, DBUS_TYPE_STRING, &remote_user_dir, DBUS_TYPE_INVALID);
17123
b1ef108e361b Minor formatting tweaks for the dbus_uniq code.
Richard Laager <rlaager@pidgin.im>
parents: 17122
diff changeset
408 remote_user_dir = g_strdup(remote_user_dir);
17121
43d41f5ce17b Alternative dbus_uniq implementation
Gabriel Schulhof <nix@go-nix.ca>
parents: 16763
diff changeset
409 dbus_error_free(&dbus_error);
43d41f5ce17b Alternative dbus_uniq implementation
Gabriel Schulhof <nix@go-nix.ca>
parents: 16763
diff changeset
410 dbus_message_unref(reply);
17122
5ba216aa4583 Style changes + removed unnecessary NULL checks.
Gabriel Schulhof <nix@go-nix.ca>
parents: 17121
diff changeset
411 }
17121
43d41f5ce17b Alternative dbus_uniq implementation
Gabriel Schulhof <nix@go-nix.ca>
parents: 16763
diff changeset
412
43d41f5ce17b Alternative dbus_uniq implementation
Gabriel Schulhof <nix@go-nix.ca>
parents: 16763
diff changeset
413 return remote_user_dir;
43d41f5ce17b Alternative dbus_uniq implementation
Gabriel Schulhof <nix@go-nix.ca>
parents: 16763
diff changeset
414 }
43d41f5ce17b Alternative dbus_uniq implementation
Gabriel Schulhof <nix@go-nix.ca>
parents: 16763
diff changeset
415
43d41f5ce17b Alternative dbus_uniq implementation
Gabriel Schulhof <nix@go-nix.ca>
parents: 16763
diff changeset
416 #endif /* HAVE_DBUS */
43d41f5ce17b Alternative dbus_uniq implementation
Gabriel Schulhof <nix@go-nix.ca>
parents: 16763
diff changeset
417
17882
35499bfa38fb Style changes.
Richard Laager <rlaager@pidgin.im>
parents: 17220
diff changeset
418 gboolean
35499bfa38fb Style changes.
Richard Laager <rlaager@pidgin.im>
parents: 17220
diff changeset
419 purple_core_ensure_single_instance()
17121
43d41f5ce17b Alternative dbus_uniq implementation
Gabriel Schulhof <nix@go-nix.ca>
parents: 16763
diff changeset
420 {
17882
35499bfa38fb Style changes.
Richard Laager <rlaager@pidgin.im>
parents: 17220
diff changeset
421 gboolean is_single_instance = TRUE;
17121
43d41f5ce17b Alternative dbus_uniq implementation
Gabriel Schulhof <nix@go-nix.ca>
parents: 16763
diff changeset
422 #ifdef HAVE_DBUS
17122
5ba216aa4583 Style changes + removed unnecessary NULL checks.
Gabriel Schulhof <nix@go-nix.ca>
parents: 17121
diff changeset
423 /* in the future, other mechanisms might have already set this to FALSE */
17882
35499bfa38fb Style changes.
Richard Laager <rlaager@pidgin.im>
parents: 17220
diff changeset
424 if (is_single_instance)
35499bfa38fb Style changes.
Richard Laager <rlaager@pidgin.im>
parents: 17220
diff changeset
425 {
35499bfa38fb Style changes.
Richard Laager <rlaager@pidgin.im>
parents: 17220
diff changeset
426 if (!purple_dbus_is_owner())
35499bfa38fb Style changes.
Richard Laager <rlaager@pidgin.im>
parents: 17220
diff changeset
427 {
17121
43d41f5ce17b Alternative dbus_uniq implementation
Gabriel Schulhof <nix@go-nix.ca>
parents: 16763
diff changeset
428 const char *user_dir = purple_user_dir();
43d41f5ce17b Alternative dbus_uniq implementation
Gabriel Schulhof <nix@go-nix.ca>
parents: 16763
diff changeset
429 char *dbus_owner_user_dir = purple_dbus_owner_user_dir();
43d41f5ce17b Alternative dbus_uniq implementation
Gabriel Schulhof <nix@go-nix.ca>
parents: 16763
diff changeset
430
25859
b42be7bb9dac Patch from Paul Aurich to add purple_strequal to help readability and simplicity of code. Ie, don't need to negate the value of strcmp, since this does a strcmp and does the negation for us
Paul Aurich <darkrain42@pidgin.im>
parents: 25855
diff changeset
431 is_single_instance = !purple_strequal(dbus_owner_user_dir, user_dir);
17121
43d41f5ce17b Alternative dbus_uniq implementation
Gabriel Schulhof <nix@go-nix.ca>
parents: 16763
diff changeset
432 g_free(dbus_owner_user_dir);
43d41f5ce17b Alternative dbus_uniq implementation
Gabriel Schulhof <nix@go-nix.ca>
parents: 16763
diff changeset
433 }
17122
5ba216aa4583 Style changes + removed unnecessary NULL checks.
Gabriel Schulhof <nix@go-nix.ca>
parents: 17121
diff changeset
434 }
17121
43d41f5ce17b Alternative dbus_uniq implementation
Gabriel Schulhof <nix@go-nix.ca>
parents: 16763
diff changeset
435 #endif /* HAVE_DBUS */
17123
b1ef108e361b Minor formatting tweaks for the dbus_uniq code.
Richard Laager <rlaager@pidgin.im>
parents: 17122
diff changeset
436
17121
43d41f5ce17b Alternative dbus_uniq implementation
Gabriel Schulhof <nix@go-nix.ca>
parents: 16763
diff changeset
437 return is_single_instance;
43d41f5ce17b Alternative dbus_uniq implementation
Gabriel Schulhof <nix@go-nix.ca>
parents: 16763
diff changeset
438 }
43d41f5ce17b Alternative dbus_uniq implementation
Gabriel Schulhof <nix@go-nix.ca>
parents: 16763
diff changeset
439
18441
d255d04c0aa1 core support for UI info...now to do the UI piece
Nathan Walp <nwalp@pidgin.im>
parents: 18303
diff changeset
440 GHashTable* purple_core_get_ui_info() {
d255d04c0aa1 core support for UI info...now to do the UI piece
Nathan Walp <nwalp@pidgin.im>
parents: 18303
diff changeset
441 PurpleCoreUiOps *ops = purple_core_get_ui_ops();
d255d04c0aa1 core support for UI info...now to do the UI piece
Nathan Walp <nwalp@pidgin.im>
parents: 18303
diff changeset
442
d255d04c0aa1 core support for UI info...now to do the UI piece
Nathan Walp <nwalp@pidgin.im>
parents: 18303
diff changeset
443 if(NULL == ops || NULL == ops->get_ui_info)
d255d04c0aa1 core support for UI info...now to do the UI piece
Nathan Walp <nwalp@pidgin.im>
parents: 18303
diff changeset
444 return NULL;
d255d04c0aa1 core support for UI info...now to do the UI piece
Nathan Walp <nwalp@pidgin.im>
parents: 18303
diff changeset
445
d255d04c0aa1 core support for UI info...now to do the UI piece
Nathan Walp <nwalp@pidgin.im>
parents: 18303
diff changeset
446 return ops->get_ui_info();
d255d04c0aa1 core support for UI info...now to do the UI piece
Nathan Walp <nwalp@pidgin.im>
parents: 18303
diff changeset
447 }

mercurial