libpurple/core.c

Tue, 06 Apr 2021 03:35:20 -0500

author
Gary Kramlich <grim@reaperworld.com>
date
Tue, 06 Apr 2021 03:35:20 -0500
changeset 40840
b5f355f90ab0
parent 40743
7aa6153abf4d
child 40853
d3518ff99fa7
permissions
-rw-r--r--

Port the updates from 2.14.2 and the upcoming 2.14.3 to 3.0.0

* Use the unicode version of the System and UserInfo plugins to fix
non-english languages in the Windows installer.
* Update the installer to use the inetc plugin so that https downloads will
work. This became necessary because Sourceforge now redirects http to
https.
* Standardize everything in pidgin/win32/winpidgin.c to use `wprintf`.

Testing Done:
Compiled and ran on windows 10.

Reviewed at https://reviews.imfreedom.org/r/595/

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 */
40441
f23c7e772667 Make sure we're not including the gettext macros in header files and deal with the repercussions of that.
Gary Kramlich <grim@reaperworld.com>
parents: 40439
diff changeset
21
f23c7e772667 Make sure we're not including the gettext macros in header files and deal with the repercussions of that.
Gary Kramlich <grim@reaperworld.com>
parents: 40439
diff changeset
22 #include <glib/gi18n-lib.h>
f23c7e772667 Make sure we're not including the gettext macros in header files and deal with the repercussions of that.
Gary Kramlich <grim@reaperworld.com>
parents: 40439
diff changeset
23
6179
4df73df94250 [gaim-migrate @ 6664]
Christian Hammond <chipx86@chipx86.com>
parents: 6168
diff changeset
24 #include "internal.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
25 #include "cmds.h"
6179
4df73df94250 [gaim-migrate @ 6664]
Christian Hammond <chipx86@chipx86.com>
parents: 6168
diff changeset
26 #include "connection.h"
4df73df94250 [gaim-migrate @ 6664]
Christian Hammond <chipx86@chipx86.com>
parents: 6168
diff changeset
27 #include "conversation.h"
4df73df94250 [gaim-migrate @ 6664]
Christian Hammond <chipx86@chipx86.com>
parents: 6168
diff changeset
28 #include "core.h"
4df73df94250 [gaim-migrate @ 6664]
Christian Hammond <chipx86@chipx86.com>
parents: 6168
diff changeset
29 #include "debug.h"
34910
60502558e400 Replacements for the GObject Xfer API
Ankit Vani <a@nevitus.org>
parents: 34883
diff changeset
30 #include "xfer.h"
12272
4eee92ead973 [gaim-migrate @ 14574]
Mark Doliner <markdoliner@pidgin.im>
parents: 12129
diff changeset
31 #include "idle.h"
35803
caa6f35efd7a Image store: very initial implementation
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 35787
diff changeset
32 #include "image-store.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
33 #include "keyring.h"
8231
347c8992c445 [gaim-migrate @ 8954]
Tim Ringenbach <marv@pidgin.im>
parents: 8046
diff changeset
34 #include "network.h"
12129
314cd0274e6a [gaim-migrate @ 14429]
Ka-Hing Cheung <khc@pidgin.im>
parents: 12080
diff changeset
35 #include "notify.h"
36367
891eea799578 Renamed plugin.[ch] to plugins.[ch], since we (will) no longer have a PurplePlugin structure.
Ankit Vani <a@nevitus.org>
parents: 34855
diff changeset
36 #include "plugins.h"
6179
4df73df94250 [gaim-migrate @ 6664]
Christian Hammond <chipx86@chipx86.com>
parents: 6168
diff changeset
37 #include "prefs.h"
4df73df94250 [gaim-migrate @ 6664]
Christian Hammond <chipx86@chipx86.com>
parents: 6168
diff changeset
38 #include "proxy.h"
40743
7aa6153abf4d Create a no operation credential provider and fix a number of other issues
Gary Kramlich <grim@reaperworld.com>
parents: 40735
diff changeset
39 #include "purplecredentialmanager.h"
40696
cf58ec89b1e4 Rename message.[ch] to purplemessage.[ch]
Gary Kramlich <grim@reaperworld.com>
parents: 40683
diff changeset
40 #include "purplemessage.h"
40439
e9838d634d5e Make sure that internal.h can only be included by libpurple and split out some pieces to purpleprivate.h
Gary Kramlich <grim@reaperworld.com>
parents: 40348
diff changeset
41 #include "purpleprivate.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"
35787
8738f1797803 Smiley parser: don't replace smileys inside HTML tags
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 35778
diff changeset
45 #include "smiley-parser.h"
35703
238e0042049a PurpleSmileyTheme: abstract implementation
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 35698
diff changeset
46 #include "smiley-theme.h"
9944
71ef020ec4b0 [gaim-migrate @ 10838]
Christian Hammond <chipx86@chipx86.com>
parents: 9649
diff changeset
47 #include "status.h"
11424
b0f8535daa74 [gaim-migrate @ 13661]
Thomas Butter <tbutter@users.sourceforge.net>
parents: 11281
diff changeset
48 #include "stun.h"
25884
c00e14c20165 * Alphabetize files in a few Makefile.am files
Mark Doliner <markdoliner@pidgin.im>
parents: 25871
diff changeset
49 #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
50 #include "util.h"
2416
32a1499fe87e [gaim-migrate @ 2429]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
diff changeset
51
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15678
diff changeset
52 struct PurpleCore
6179
4df73df94250 [gaim-migrate @ 6664]
Christian Hammond <chipx86@chipx86.com>
parents: 6168
diff changeset
53 {
4df73df94250 [gaim-migrate @ 6664]
Christian Hammond <chipx86@chipx86.com>
parents: 6168
diff changeset
54 char *ui;
4df73df94250 [gaim-migrate @ 6664]
Christian Hammond <chipx86@chipx86.com>
parents: 6168
diff changeset
55
4df73df94250 [gaim-migrate @ 6664]
Christian Hammond <chipx86@chipx86.com>
parents: 6168
diff changeset
56 void *reserved;
4df73df94250 [gaim-migrate @ 6664]
Christian Hammond <chipx86@chipx86.com>
parents: 6168
diff changeset
57 };
4df73df94250 [gaim-migrate @ 6664]
Christian Hammond <chipx86@chipx86.com>
parents: 6168
diff changeset
58
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15678
diff changeset
59 static PurpleCoreUiOps *_ops = NULL;
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15678
diff changeset
60 static PurpleCore *_core = NULL;
6179
4df73df94250 [gaim-migrate @ 6664]
Christian Hammond <chipx86@chipx86.com>
parents: 6168
diff changeset
61
34297
0f1f0b8c84f8 Fix some debug log warnings, adjust verbosity level
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34165
diff changeset
62 static void
0f1f0b8c84f8 Fix some debug log warnings, adjust verbosity level
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34165
diff changeset
63 purple_core_print_version(void)
0f1f0b8c84f8 Fix some debug log warnings, adjust verbosity level
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34165
diff changeset
64 {
40312
956745ff3ee8 Replace the ui info GHashTable with a gobject.
Gary Kramlich <grim@reaperworld.com>
parents: 40195
diff changeset
65 PurpleUiInfo *ui_info = purple_core_get_ui_info();
40336
4e766d681de5 purple_core_get_ui_info now transfers the PurpleUiInfo to the caller, so we need to make sure to not cache it.
Gary Kramlich <grim@reaperworld.com>
parents: 40313
diff changeset
66 const gchar *ui_name = NULL;
4e766d681de5 purple_core_get_ui_info now transfers the PurpleUiInfo to the caller, so we need to make sure to not cache it.
Gary Kramlich <grim@reaperworld.com>
parents: 40313
diff changeset
67 const gchar *ui_version = NULL;
34297
0f1f0b8c84f8 Fix some debug log warnings, adjust verbosity level
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34165
diff changeset
68 gchar *ui_full_name = NULL;
0f1f0b8c84f8 Fix some debug log warnings, adjust verbosity level
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34165
diff changeset
69
40313
d0f01217e491 the ui can return a null PurpleUiInfo so we need to handle that
Gary Kramlich <grim@reaperworld.com>
parents: 40312
diff changeset
70 if(PURPLE_IS_UI_INFO(ui_info)) {
d0f01217e491 the ui can return a null PurpleUiInfo so we need to handle that
Gary Kramlich <grim@reaperworld.com>
parents: 40312
diff changeset
71 ui_name = purple_ui_info_get_name(ui_info);
d0f01217e491 the ui can return a null PurpleUiInfo so we need to handle that
Gary Kramlich <grim@reaperworld.com>
parents: 40312
diff changeset
72 ui_version = purple_ui_info_get_version(ui_info);
d0f01217e491 the ui can return a null PurpleUiInfo so we need to handle that
Gary Kramlich <grim@reaperworld.com>
parents: 40312
diff changeset
73 }
34297
0f1f0b8c84f8 Fix some debug log warnings, adjust verbosity level
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34165
diff changeset
74
0f1f0b8c84f8 Fix some debug log warnings, adjust verbosity level
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34165
diff changeset
75 if (ui_name) {
39918
1c8e11f9274f Fix several memory leaks.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39441
diff changeset
76 if (ui_version) {
1c8e11f9274f Fix several memory leaks.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39441
diff changeset
77 ui_full_name = g_strdup_printf("%s %s", ui_name, ui_version);
1c8e11f9274f Fix several memory leaks.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39441
diff changeset
78 } else {
1c8e11f9274f Fix several memory leaks.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39441
diff changeset
79 ui_full_name = g_strdup(ui_name);
1c8e11f9274f Fix several memory leaks.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39441
diff changeset
80 }
34297
0f1f0b8c84f8 Fix some debug log warnings, adjust verbosity level
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34165
diff changeset
81 }
0f1f0b8c84f8 Fix some debug log warnings, adjust verbosity level
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34165
diff changeset
82
0f1f0b8c84f8 Fix some debug log warnings, adjust verbosity level
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34165
diff changeset
83 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
84 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
85 ui_full_name ? " with " : "",
0f1f0b8c84f8 Fix some debug log warnings, adjust verbosity level
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34165
diff changeset
86 purple_core_get_version());
0f1f0b8c84f8 Fix some debug log warnings, adjust verbosity level
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34165
diff changeset
87
39918
1c8e11f9274f Fix several memory leaks.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39441
diff changeset
88 g_free(ui_full_name);
40313
d0f01217e491 the ui can return a null PurpleUiInfo so we need to handle that
Gary Kramlich <grim@reaperworld.com>
parents: 40312
diff changeset
89
d0f01217e491 the ui can return a null PurpleUiInfo so we need to handle that
Gary Kramlich <grim@reaperworld.com>
parents: 40312
diff changeset
90 if(PURPLE_IS_UI_INFO(ui_info)) {
d0f01217e491 the ui can return a null PurpleUiInfo so we need to handle that
Gary Kramlich <grim@reaperworld.com>
parents: 40312
diff changeset
91 g_object_unref(G_OBJECT(ui_info));
d0f01217e491 the ui can return a null PurpleUiInfo so we need to handle that
Gary Kramlich <grim@reaperworld.com>
parents: 40312
diff changeset
92 }
34297
0f1f0b8c84f8 Fix some debug log warnings, adjust verbosity level
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34165
diff changeset
93 }
0f1f0b8c84f8 Fix some debug log warnings, adjust verbosity level
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34165
diff changeset
94
6179
4df73df94250 [gaim-migrate @ 6664]
Christian Hammond <chipx86@chipx86.com>
parents: 6168
diff changeset
95 gboolean
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15678
diff changeset
96 purple_core_init(const char *ui)
6179
4df73df94250 [gaim-migrate @ 6664]
Christian Hammond <chipx86@chipx86.com>
parents: 6168
diff changeset
97 {
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15678
diff changeset
98 PurpleCoreUiOps *ops;
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15678
diff changeset
99 PurpleCore *core;
6179
4df73df94250 [gaim-migrate @ 6664]
Christian Hammond <chipx86@chipx86.com>
parents: 6168
diff changeset
100
4df73df94250 [gaim-migrate @ 6664]
Christian Hammond <chipx86@chipx86.com>
parents: 6168
diff changeset
101 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
102 g_return_val_if_fail(purple_get_core() == NULL, FALSE);
6179
4df73df94250 [gaim-migrate @ 6664]
Christian Hammond <chipx86@chipx86.com>
parents: 6168
diff changeset
103
35850
1abeda205d6c cross-win32: make dirs more flexible, add them to the config.h
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 35811
diff changeset
104 bindtextdomain(PACKAGE, PURPLE_LOCALEDIR);
39374
d6261d7d0c91 Remove ENABLE_NLS guards, making 'nls' only affect po/ directory
Mike Ruprecht <cmaiku@gmail.com>
parents: 39353
diff changeset
105
14286
9ff15ceacd34 [gaim-migrate @ 16905]
Daniel Atallah <datallah@pidgin.im>
parents: 14254
diff changeset
106 #ifdef _WIN32
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15678
diff changeset
107 wpurple_init();
14286
9ff15ceacd34 [gaim-migrate @ 16905]
Daniel Atallah <datallah@pidgin.im>
parents: 14254
diff changeset
108 #endif
9ff15ceacd34 [gaim-migrate @ 16905]
Daniel Atallah <datallah@pidgin.im>
parents: 14254
diff changeset
109
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15678
diff changeset
110 _core = core = g_new0(PurpleCore, 1);
6179
4df73df94250 [gaim-migrate @ 6664]
Christian Hammond <chipx86@chipx86.com>
parents: 6168
diff changeset
111 core->ui = g_strdup(ui);
4df73df94250 [gaim-migrate @ 6664]
Christian Hammond <chipx86@chipx86.com>
parents: 6168
diff changeset
112 core->reserved = NULL;
4df73df94250 [gaim-migrate @ 6664]
Christian Hammond <chipx86@chipx86.com>
parents: 6168
diff changeset
113
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15678
diff changeset
114 ops = purple_core_get_ui_ops();
6179
4df73df94250 [gaim-migrate @ 6664]
Christian Hammond <chipx86@chipx86.com>
parents: 6168
diff changeset
115
6485
3c7ba18e32f1 [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents: 6371
diff changeset
116 /* 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
117 purple_signals_init();
6485
3c7ba18e32f1 [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents: 6371
diff changeset
118
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
119 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
120
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15678
diff changeset
121 purple_signal_register(core, "uri-handler",
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15678
diff changeset
122 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
123 G_TYPE_BOOLEAN, 3,
a65e961e1e29 Refactored core, ft, imgstore to use GType instead of PurpleValue
Ankit Vani <a@nevitus.org>
parents: 34583
diff changeset
124 G_TYPE_STRING, /* Protocol */
a65e961e1e29 Refactored core, ft, imgstore to use GType instead of PurpleValue
Ankit Vani <a@nevitus.org>
parents: 34583
diff changeset
125 G_TYPE_STRING, /* Command */
a65e961e1e29 Refactored core, ft, imgstore to use GType instead of PurpleValue
Ankit Vani <a@nevitus.org>
parents: 34583
diff changeset
126 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
127
34818
a65e961e1e29 Refactored core, ft, imgstore to use GType instead of PurpleValue
Ankit Vani <a@nevitus.org>
parents: 34583
diff changeset
128 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
129 0);
a65e961e1e29 Refactored core, ft, imgstore to use GType instead of PurpleValue
Ankit Vani <a@nevitus.org>
parents: 34583
diff changeset
130 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
131 G_TYPE_NONE, 0);
6485
3c7ba18e32f1 [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents: 6371
diff changeset
132
34297
0f1f0b8c84f8 Fix some debug log warnings, adjust verbosity level
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34165
diff changeset
133 purple_core_print_version();
6485
3c7ba18e32f1 [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents: 6371
diff changeset
134
10087
e5b80a38939d [gaim-migrate @ 11098]
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 9944
diff changeset
135 /* The prefs subsystem needs to be initialized before static protocols
e5b80a38939d [gaim-migrate @ 11098]
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 9944
diff changeset
136 * for protocol prefs to work. */
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15678
diff changeset
137 purple_prefs_init();
10087
e5b80a38939d [gaim-migrate @ 11098]
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 9944
diff changeset
138
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15678
diff changeset
139 purple_debug_init();
10448
4415ffba12e9 [gaim-migrate @ 11713]
Mark Doliner <markdoliner@pidgin.im>
parents: 10418
diff changeset
140
9944
71ef020ec4b0 [gaim-migrate @ 10838]
Christian Hammond <chipx86@chipx86.com>
parents: 9649
diff changeset
141 if (ops != NULL)
71ef020ec4b0 [gaim-migrate @ 10838]
Christian Hammond <chipx86@chipx86.com>
parents: 9649
diff changeset
142 {
6179
4df73df94250 [gaim-migrate @ 6664]
Christian Hammond <chipx86@chipx86.com>
parents: 6168
diff changeset
143 if (ops->ui_prefs_init != NULL)
4df73df94250 [gaim-migrate @ 6664]
Christian Hammond <chipx86@chipx86.com>
parents: 6168
diff changeset
144 ops->ui_prefs_init();
4df73df94250 [gaim-migrate @ 6664]
Christian Hammond <chipx86@chipx86.com>
parents: 6168
diff changeset
145
4df73df94250 [gaim-migrate @ 6664]
Christian Hammond <chipx86@chipx86.com>
parents: 6168
diff changeset
146 if (ops->debug_ui_init != NULL)
4df73df94250 [gaim-migrate @ 6664]
Christian Hammond <chipx86@chipx86.com>
parents: 6168
diff changeset
147 ops->debug_ui_init();
4df73df94250 [gaim-migrate @ 6664]
Christian Hammond <chipx86@chipx86.com>
parents: 6168
diff changeset
148 }
4df73df94250 [gaim-migrate @ 6664]
Christian Hammond <chipx86@chipx86.com>
parents: 6168
diff changeset
149
23847
a4260c372f4c Initialize the commands subsystem before the plugins.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 23555
diff changeset
150 purple_cmds_init();
40735
cc0679f47fd9 Create a new PurpleProtocolManager
Gary Kramlich <grim@reaperworld.com>
parents: 40734
diff changeset
151 purple_protocol_manager_startup();
16660
05ee74f25b2a Part of the patch in ticket #383:
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 16608
diff changeset
152
40734
c792b39da167 Port the secretservice keyring to PurpleCredentialProvider
Gary Kramlich <grim@reaperworld.com>
parents: 40696
diff changeset
153 purple_credential_manager_startup(); /* before accounts */
c792b39da167 Port the secretservice keyring to PurpleCredentialProvider
Gary Kramlich <grim@reaperworld.com>
parents: 40696
diff changeset
154
11033
dc68e074f10d [gaim-migrate @ 12919]
Etan Reisner <deryni@pidgin.im>
parents: 10684
diff changeset
155 /* Since plugins get probed so early we should probably initialize their
dc68e074f10d [gaim-migrate @ 12919]
Etan Reisner <deryni@pidgin.im>
parents: 10684
diff changeset
156 * subsystem right away too.
dc68e074f10d [gaim-migrate @ 12919]
Etan Reisner <deryni@pidgin.im>
parents: 10684
diff changeset
157 */
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15678
diff changeset
158 purple_plugins_init();
25339
1ccd84242080 disapproval of revision '72679a30e1cb464d1dc7c74b14b848c3a51538ca'
Daniel Atallah <datallah@pidgin.im>
parents: 25338
diff changeset
159
34165
cdd4b0dfe92b keyring.c refactoring: use signal instead of hack depending on implementation
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34148
diff changeset
160 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
161 purple_theme_manager_init();
25884
c00e14c20165 * Alphabetize files in a few Makefile.am files
Mark Doliner <markdoliner@pidgin.im>
parents: 25871
diff changeset
162
35811
f86e09b6ed33 Small imgstore cleanup
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 35806
diff changeset
163 /* The buddy icon code uses the image store, so init it early. */
35803
caa6f35efd7a Image store: very initial implementation
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 35787
diff changeset
164 _purple_image_store_init();
16437
7ff7c3405ea2 Rework the buddy icon subsystem to use the imgstore subsystem, and modify the
Richard Laager <rlaager@pidgin.im>
parents: 16409
diff changeset
165
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
166 /* 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
167 * 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
168 */
34855
9c289149eed4 Global replaces according to GObject status API
Ankit Vani <a@nevitus.org>
parents: 34818
diff changeset
169 purple_statuses_init();
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15678
diff changeset
170 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
171 purple_connections_init();
13481
6a4badb9f8e4 [gaim-migrate @ 15856]
Evan Schoenberg <evands@pidgin.im>
parents: 13294
diff changeset
172
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15678
diff changeset
173 purple_accounts_init();
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15678
diff changeset
174 purple_savedstatuses_init();
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15678
diff changeset
175 purple_notify_init();
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15678
diff changeset
176 purple_conversations_init();
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15678
diff changeset
177 purple_blist_init();
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15678
diff changeset
178 purple_log_init();
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15678
diff changeset
179 purple_network_init();
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15678
diff changeset
180 purple_proxy_init();
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15678
diff changeset
181 purple_stun_init();
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15678
diff changeset
182 purple_xfers_init();
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15678
diff changeset
183 purple_idle_init();
35776
901a94245460 Comments: custom smileys
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 35715
diff changeset
184 _purple_smiley_custom_init();
35787
8738f1797803 Smiley parser: don't replace smileys inside HTML tags
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 35778
diff changeset
185 _purple_smiley_parser_init();
35715
2aa79f05247e Custom smileys storage
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 35703
diff changeset
186
15116
037b787407ba [gaim-migrate @ 17838]
Mark Doliner <markdoliner@pidgin.im>
parents: 14300
diff changeset
187 /*
037b787407ba [gaim-migrate @ 17838]
Mark Doliner <markdoliner@pidgin.im>
parents: 14300
diff changeset
188 * 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
189 * hopefully save some time later.
037b787407ba [gaim-migrate @ 17838]
Mark Doliner <markdoliner@pidgin.im>
parents: 14300
diff changeset
190 */
40663
2453bef0abe7 Cleanup local IP getters
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 40655
diff changeset
191 purple_network_discover_my_ip();
13181
2a22fe4717ed [gaim-migrate @ 15543]
Daniel Atallah <datallah@pidgin.im>
parents: 13130
diff changeset
192
6179
4df73df94250 [gaim-migrate @ 6664]
Christian Hammond <chipx86@chipx86.com>
parents: 6168
diff changeset
193 if (ops != NULL && ops->ui_init != NULL)
4df73df94250 [gaim-migrate @ 6664]
Christian Hammond <chipx86@chipx86.com>
parents: 6168
diff changeset
194 ops->ui_init();
4df73df94250 [gaim-migrate @ 6664]
Christian Hammond <chipx86@chipx86.com>
parents: 6168
diff changeset
195
25862
57228df2541f Fix the issue with the themes not showing up in the list.
Paul Aurich <darkrain42@pidgin.im>
parents: 25859
diff changeset
196 /* 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
197 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
198
33643
6f7deddb8850 Move blist loading into purple_core_init.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33538
diff changeset
199 /* 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
200 purple_blist_boot();
6f7deddb8850 Move blist loading into purple_core_init.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33538
diff changeset
201
34127
51c1bce7f52f Tidying debug messages, signals
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34125
diff changeset
202 purple_signal_emit(purple_get_core(), "core-initialized");
51c1bce7f52f Tidying debug messages, signals
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34125
diff changeset
203
6179
4df73df94250 [gaim-migrate @ 6664]
Christian Hammond <chipx86@chipx86.com>
parents: 6168
diff changeset
204 return TRUE;
4df73df94250 [gaim-migrate @ 6664]
Christian Hammond <chipx86@chipx86.com>
parents: 6168
diff changeset
205 }
4df73df94250 [gaim-migrate @ 6664]
Christian Hammond <chipx86@chipx86.com>
parents: 6168
diff changeset
206
4df73df94250 [gaim-migrate @ 6664]
Christian Hammond <chipx86@chipx86.com>
parents: 6168
diff changeset
207 void
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15678
diff changeset
208 purple_core_quit(void)
6179
4df73df94250 [gaim-migrate @ 6664]
Christian Hammond <chipx86@chipx86.com>
parents: 6168
diff changeset
209 {
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15678
diff changeset
210 PurpleCoreUiOps *ops;
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15678
diff changeset
211 PurpleCore *core = purple_get_core();
40743
7aa6153abf4d Create a no operation credential provider and fix a number of other issues
Gary Kramlich <grim@reaperworld.com>
parents: 40735
diff changeset
212 PurpleCredentialManager *manager = NULL;
6179
4df73df94250 [gaim-migrate @ 6664]
Christian Hammond <chipx86@chipx86.com>
parents: 6168
diff changeset
213
4df73df94250 [gaim-migrate @ 6664]
Christian Hammond <chipx86@chipx86.com>
parents: 6168
diff changeset
214 g_return_if_fail(core != NULL);
4df73df94250 [gaim-migrate @ 6664]
Christian Hammond <chipx86@chipx86.com>
parents: 6168
diff changeset
215
4df73df94250 [gaim-migrate @ 6664]
Christian Hammond <chipx86@chipx86.com>
parents: 6168
diff changeset
216 /* The self destruct sequence has been initiated */
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15678
diff changeset
217 purple_signal_emit(purple_get_core(), "quitting");
6179
4df73df94250 [gaim-migrate @ 6664]
Christian Hammond <chipx86@chipx86.com>
parents: 6168
diff changeset
218
40743
7aa6153abf4d Create a no operation credential provider and fix a number of other issues
Gary Kramlich <grim@reaperworld.com>
parents: 40735
diff changeset
219 /* Remove the active provider in the credential manager. */
7aa6153abf4d Create a no operation credential provider and fix a number of other issues
Gary Kramlich <grim@reaperworld.com>
parents: 40735
diff changeset
220 manager = purple_credential_manager_get_default();
7aa6153abf4d Create a no operation credential provider and fix a number of other issues
Gary Kramlich <grim@reaperworld.com>
parents: 40735
diff changeset
221 purple_credential_manager_set_active_provider(manager, NULL, NULL);
7aa6153abf4d Create a no operation credential provider and fix a number of other issues
Gary Kramlich <grim@reaperworld.com>
parents: 40735
diff changeset
222
6179
4df73df94250 [gaim-migrate @ 6664]
Christian Hammond <chipx86@chipx86.com>
parents: 6168
diff changeset
223 /* Transmission ends */
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15678
diff changeset
224 purple_connections_disconnect_all();
6179
4df73df94250 [gaim-migrate @ 6664]
Christian Hammond <chipx86@chipx86.com>
parents: 6168
diff changeset
225
8235
00045afab151 [gaim-migrate @ 8958]
Gary Kramlich <grim@pidgin.im>
parents: 8231
diff changeset
226 /* Save .xml files, remove signals, etc. */
35778
8ea15abd8688 Comments: PurpleSmileyTheme
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 35776
diff changeset
227 _purple_smiley_theme_uninit();
35776
901a94245460 Comments: custom smileys
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 35715
diff changeset
228 _purple_smiley_custom_uninit();
35787
8738f1797803 Smiley parser: don't replace smileys inside HTML tags
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 35778
diff changeset
229 _purple_smiley_parser_uninit();
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15678
diff changeset
230 purple_idle_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
231 purple_conversations_uninit();
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15678
diff changeset
232 purple_blist_uninit();
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15678
diff changeset
233 purple_notify_uninit();
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15678
diff changeset
234 purple_connections_uninit();
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15678
diff changeset
235 purple_buddy_icons_uninit();
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15678
diff changeset
236 purple_savedstatuses_uninit();
34855
9c289149eed4 Global replaces according to GObject status API
Ankit Vani <a@nevitus.org>
parents: 34818
diff changeset
237 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
238 purple_accounts_uninit();
34127
51c1bce7f52f Tidying debug messages, signals
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34125
diff changeset
239 purple_keyring_uninit(); /* after accounts */
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
240 purple_theme_manager_uninit();
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15678
diff changeset
241 purple_xfers_uninit();
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15678
diff changeset
242 purple_proxy_uninit();
35803
caa6f35efd7a Image store: very initial implementation
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 35787
diff changeset
243 _purple_image_store_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
244 purple_network_uninit();
6485
3c7ba18e32f1 [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents: 6371
diff changeset
245
25713
9dc831db9cce Alternate, API-safe fix for #8774 (crash on exit)
Ethan Blanton <elb@pidgin.im>
parents: 25712
diff changeset
246 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
247 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
248 ops->quit();
9dc831db9cce Alternate, API-safe fix for #8774 (crash on exit)
Ethan Blanton <elb@pidgin.im>
parents: 25712
diff changeset
249
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
250 /* 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
251 purple_prefs_uninit();
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15678
diff changeset
252 purple_plugins_uninit();
36458
a9cccad073e9 Static prpls now work. Added macro PURPLE_PLUGIN_INIT(plugin-name, query-func, load-func, unload-func).
Ankit Vani <a@nevitus.org>
parents: 36375
diff changeset
253
40743
7aa6153abf4d Create a no operation credential provider and fix a number of other issues
Gary Kramlich <grim@reaperworld.com>
parents: 40735
diff changeset
254 /* after plugins */
7aa6153abf4d Create a no operation credential provider and fix a number of other issues
Gary Kramlich <grim@reaperworld.com>
parents: 40735
diff changeset
255 purple_credential_manager_shutdown();
40735
cc0679f47fd9 Create a new PurpleProtocolManager
Gary Kramlich <grim@reaperworld.com>
parents: 40734
diff changeset
256 purple_protocol_manager_shutdown();
40743
7aa6153abf4d Create a no operation credential provider and fix a number of other issues
Gary Kramlich <grim@reaperworld.com>
parents: 40735
diff changeset
257 purple_cmds_uninit();
36375
8ed701a7333e Added a protocols subsystem API and a protocols API to add/remove protocols.
Ankit Vani <a@nevitus.org>
parents: 36367
diff changeset
258
33538
cbeb76707f12 Better implementation of purple_escape_js
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 33439
diff changeset
259 purple_log_uninit();
cbeb76707f12 Better implementation of purple_escape_js
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 33439
diff changeset
260 /* Everything after util_uninit cannot try to write things to the
40123
15c3354736c3 Remove some unused utility functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 40058
diff changeset
261 * confdir.
33538
cbeb76707f12 Better implementation of purple_escape_js
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 33439
diff changeset
262 */
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
263 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
264
18303
5cc245e1fcf3 Uninit the dbus system before uniniting the signals.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 18267
diff changeset
265 purple_signals_uninit();
14017
db3f1bdc95c6 [gaim-migrate @ 16503]
Mark Doliner <markdoliner@pidgin.im>
parents: 13481
diff changeset
266
14097
0c340861ab79 [gaim-migrate @ 16638]
Mark Doliner <markdoliner@pidgin.im>
parents: 14017
diff changeset
267 g_free(core->ui);
6179
4df73df94250 [gaim-migrate @ 6664]
Christian Hammond <chipx86@chipx86.com>
parents: 6168
diff changeset
268 g_free(core);
4df73df94250 [gaim-migrate @ 6664]
Christian Hammond <chipx86@chipx86.com>
parents: 6168
diff changeset
269
14286
9ff15ceacd34 [gaim-migrate @ 16905]
Daniel Atallah <datallah@pidgin.im>
parents: 14254
diff changeset
270 #ifdef _WIN32
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15678
diff changeset
271 wpurple_cleanup();
14286
9ff15ceacd34 [gaim-migrate @ 16905]
Daniel Atallah <datallah@pidgin.im>
parents: 14254
diff changeset
272 #endif
9ff15ceacd34 [gaim-migrate @ 16905]
Daniel Atallah <datallah@pidgin.im>
parents: 14254
diff changeset
273
6179
4df73df94250 [gaim-migrate @ 6664]
Christian Hammond <chipx86@chipx86.com>
parents: 6168
diff changeset
274 _core = NULL;
4df73df94250 [gaim-migrate @ 6664]
Christian Hammond <chipx86@chipx86.com>
parents: 6168
diff changeset
275 }
4df73df94250 [gaim-migrate @ 6664]
Christian Hammond <chipx86@chipx86.com>
parents: 6168
diff changeset
276
7646
6806a6893ac0 [gaim-migrate @ 8289]
Mark Doliner <markdoliner@pidgin.im>
parents: 7431
diff changeset
277 gboolean
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15678
diff changeset
278 purple_core_quit_cb(gpointer unused)
7646
6806a6893ac0 [gaim-migrate @ 8289]
Mark Doliner <markdoliner@pidgin.im>
parents: 7431
diff changeset
279 {
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15678
diff changeset
280 purple_core_quit();
7646
6806a6893ac0 [gaim-migrate @ 8289]
Mark Doliner <markdoliner@pidgin.im>
parents: 7431
diff changeset
281
6806a6893ac0 [gaim-migrate @ 8289]
Mark Doliner <markdoliner@pidgin.im>
parents: 7431
diff changeset
282 return FALSE;
6806a6893ac0 [gaim-migrate @ 8289]
Mark Doliner <markdoliner@pidgin.im>
parents: 7431
diff changeset
283 }
6806a6893ac0 [gaim-migrate @ 8289]
Mark Doliner <markdoliner@pidgin.im>
parents: 7431
diff changeset
284
6612
aac6af649208 [gaim-migrate @ 7136]
Christian Hammond <chipx86@chipx86.com>
parents: 6564
diff changeset
285 const char *
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15678
diff changeset
286 purple_core_get_version(void)
6612
aac6af649208 [gaim-migrate @ 7136]
Christian Hammond <chipx86@chipx86.com>
parents: 6564
diff changeset
287 {
aac6af649208 [gaim-migrate @ 7136]
Christian Hammond <chipx86@chipx86.com>
parents: 6564
diff changeset
288 return VERSION;
aac6af649208 [gaim-migrate @ 7136]
Christian Hammond <chipx86@chipx86.com>
parents: 6564
diff changeset
289 }
aac6af649208 [gaim-migrate @ 7136]
Christian Hammond <chipx86@chipx86.com>
parents: 6564
diff changeset
290
6179
4df73df94250 [gaim-migrate @ 6664]
Christian Hammond <chipx86@chipx86.com>
parents: 6168
diff changeset
291 const char *
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15678
diff changeset
292 purple_core_get_ui(void)
6179
4df73df94250 [gaim-migrate @ 6664]
Christian Hammond <chipx86@chipx86.com>
parents: 6168
diff changeset
293 {
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15678
diff changeset
294 PurpleCore *core = purple_get_core();
6179
4df73df94250 [gaim-migrate @ 6664]
Christian Hammond <chipx86@chipx86.com>
parents: 6168
diff changeset
295
4df73df94250 [gaim-migrate @ 6664]
Christian Hammond <chipx86@chipx86.com>
parents: 6168
diff changeset
296 g_return_val_if_fail(core != NULL, NULL);
4df73df94250 [gaim-migrate @ 6664]
Christian Hammond <chipx86@chipx86.com>
parents: 6168
diff changeset
297
4df73df94250 [gaim-migrate @ 6664]
Christian Hammond <chipx86@chipx86.com>
parents: 6168
diff changeset
298 return core->ui;
4df73df94250 [gaim-migrate @ 6664]
Christian Hammond <chipx86@chipx86.com>
parents: 6168
diff changeset
299 }
4df73df94250 [gaim-migrate @ 6664]
Christian Hammond <chipx86@chipx86.com>
parents: 6168
diff changeset
300
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15678
diff changeset
301 PurpleCore *
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15678
diff changeset
302 purple_get_core(void)
6179
4df73df94250 [gaim-migrate @ 6664]
Christian Hammond <chipx86@chipx86.com>
parents: 6168
diff changeset
303 {
4df73df94250 [gaim-migrate @ 6664]
Christian Hammond <chipx86@chipx86.com>
parents: 6168
diff changeset
304 return _core;
4df73df94250 [gaim-migrate @ 6664]
Christian Hammond <chipx86@chipx86.com>
parents: 6168
diff changeset
305 }
4df73df94250 [gaim-migrate @ 6664]
Christian Hammond <chipx86@chipx86.com>
parents: 6168
diff changeset
306
35572
5c4846317f2f Box the *UiOps structures
Ankit Vani <a@nevitus.org>
parents: 35499
diff changeset
307 static PurpleCoreUiOps *
5c4846317f2f Box the *UiOps structures
Ankit Vani <a@nevitus.org>
parents: 35499
diff changeset
308 purple_core_ui_ops_copy(PurpleCoreUiOps *ops)
5c4846317f2f Box the *UiOps structures
Ankit Vani <a@nevitus.org>
parents: 35499
diff changeset
309 {
5c4846317f2f Box the *UiOps structures
Ankit Vani <a@nevitus.org>
parents: 35499
diff changeset
310 PurpleCoreUiOps *ops_new;
5c4846317f2f Box the *UiOps structures
Ankit Vani <a@nevitus.org>
parents: 35499
diff changeset
311
5c4846317f2f Box the *UiOps structures
Ankit Vani <a@nevitus.org>
parents: 35499
diff changeset
312 g_return_val_if_fail(ops != NULL, NULL);
5c4846317f2f Box the *UiOps structures
Ankit Vani <a@nevitus.org>
parents: 35499
diff changeset
313
5c4846317f2f Box the *UiOps structures
Ankit Vani <a@nevitus.org>
parents: 35499
diff changeset
314 ops_new = g_new(PurpleCoreUiOps, 1);
5c4846317f2f Box the *UiOps structures
Ankit Vani <a@nevitus.org>
parents: 35499
diff changeset
315 *ops_new = *ops;
5c4846317f2f Box the *UiOps structures
Ankit Vani <a@nevitus.org>
parents: 35499
diff changeset
316
5c4846317f2f Box the *UiOps structures
Ankit Vani <a@nevitus.org>
parents: 35499
diff changeset
317 return ops_new;
5c4846317f2f Box the *UiOps structures
Ankit Vani <a@nevitus.org>
parents: 35499
diff changeset
318 }
5c4846317f2f Box the *UiOps structures
Ankit Vani <a@nevitus.org>
parents: 35499
diff changeset
319
5c4846317f2f Box the *UiOps structures
Ankit Vani <a@nevitus.org>
parents: 35499
diff changeset
320 GType
5c4846317f2f Box the *UiOps structures
Ankit Vani <a@nevitus.org>
parents: 35499
diff changeset
321 purple_core_ui_ops_get_type(void)
5c4846317f2f Box the *UiOps structures
Ankit Vani <a@nevitus.org>
parents: 35499
diff changeset
322 {
5c4846317f2f Box the *UiOps structures
Ankit Vani <a@nevitus.org>
parents: 35499
diff changeset
323 static GType type = 0;
5c4846317f2f Box the *UiOps structures
Ankit Vani <a@nevitus.org>
parents: 35499
diff changeset
324
5c4846317f2f Box the *UiOps structures
Ankit Vani <a@nevitus.org>
parents: 35499
diff changeset
325 if (type == 0) {
5c4846317f2f Box the *UiOps structures
Ankit Vani <a@nevitus.org>
parents: 35499
diff changeset
326 type = g_boxed_type_register_static("PurpleCoreUiOps",
5c4846317f2f Box the *UiOps structures
Ankit Vani <a@nevitus.org>
parents: 35499
diff changeset
327 (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
328 (GBoxedFreeFunc)g_free);
35572
5c4846317f2f Box the *UiOps structures
Ankit Vani <a@nevitus.org>
parents: 35499
diff changeset
329 }
5c4846317f2f Box the *UiOps structures
Ankit Vani <a@nevitus.org>
parents: 35499
diff changeset
330
5c4846317f2f Box the *UiOps structures
Ankit Vani <a@nevitus.org>
parents: 35499
diff changeset
331 return type;
5c4846317f2f Box the *UiOps structures
Ankit Vani <a@nevitus.org>
parents: 35499
diff changeset
332 }
5c4846317f2f Box the *UiOps structures
Ankit Vani <a@nevitus.org>
parents: 35499
diff changeset
333
6179
4df73df94250 [gaim-migrate @ 6664]
Christian Hammond <chipx86@chipx86.com>
parents: 6168
diff changeset
334 void
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15678
diff changeset
335 purple_core_set_ui_ops(PurpleCoreUiOps *ops)
6179
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 _ops = ops;
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 PurpleCoreUiOps *
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15678
diff changeset
341 purple_core_get_ui_ops(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 _ops;
4df73df94250 [gaim-migrate @ 6664]
Christian Hammond <chipx86@chipx86.com>
parents: 6168
diff changeset
344 }
16409
8c153c6febdd The core portion of the migration code. This is implemented as I described
Richard Laager <rlaager@pidgin.im>
parents: 16124
diff changeset
345
40312
956745ff3ee8 Replace the ui info GHashTable with a gobject.
Gary Kramlich <grim@reaperworld.com>
parents: 40195
diff changeset
346 PurpleUiInfo* purple_core_get_ui_info() {
18441
d255d04c0aa1 core support for UI info...now to do the UI piece
Nathan Walp <nwalp@pidgin.im>
parents: 18303
diff changeset
347 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
348
d255d04c0aa1 core support for UI info...now to do the UI piece
Nathan Walp <nwalp@pidgin.im>
parents: 18303
diff changeset
349 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
350 return NULL;
d255d04c0aa1 core support for UI info...now to do the UI piece
Nathan Walp <nwalp@pidgin.im>
parents: 18303
diff changeset
351
d255d04c0aa1 core support for UI info...now to do the UI piece
Nathan Walp <nwalp@pidgin.im>
parents: 18303
diff changeset
352 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
353 }
38893
ea7c40572374 Move migration to core, check for errors
qarkai <qarkai@gmail.com>
parents: 38045
diff changeset
354
38895
a9214766e1c7 Replace "do {" and "} while (0)" with G_STMT_START and G_STMT_END
qarkai <qarkai@gmail.com>
parents: 38894
diff changeset
355 #define MIGRATE_TO_XDG_DIR(xdg_base_dir, legacy_path) \
a9214766e1c7 Replace "do {" and "} while (0)" with G_STMT_START and G_STMT_END
qarkai <qarkai@gmail.com>
parents: 38894
diff changeset
356 G_STMT_START { \
38893
ea7c40572374 Move migration to core, check for errors
qarkai <qarkai@gmail.com>
parents: 38045
diff changeset
357 gboolean migrate_res; \
ea7c40572374 Move migration to core, check for errors
qarkai <qarkai@gmail.com>
parents: 38045
diff changeset
358 \
ea7c40572374 Move migration to core, check for errors
qarkai <qarkai@gmail.com>
parents: 38045
diff changeset
359 migrate_res = purple_move_to_xdg_base_dir(xdg_base_dir, legacy_path); \
ea7c40572374 Move migration to core, check for errors
qarkai <qarkai@gmail.com>
parents: 38045
diff changeset
360 if (!migrate_res) { \
ea7c40572374 Move migration to core, check for errors
qarkai <qarkai@gmail.com>
parents: 38045
diff changeset
361 purple_debug_error("core", "Error migrating %s to %s\n", \
ea7c40572374 Move migration to core, check for errors
qarkai <qarkai@gmail.com>
parents: 38045
diff changeset
362 legacy_path, xdg_base_dir); \
ea7c40572374 Move migration to core, check for errors
qarkai <qarkai@gmail.com>
parents: 38045
diff changeset
363 return FALSE; \
ea7c40572374 Move migration to core, check for errors
qarkai <qarkai@gmail.com>
parents: 38045
diff changeset
364 } \
38895
a9214766e1c7 Replace "do {" and "} while (0)" with G_STMT_START and G_STMT_END
qarkai <qarkai@gmail.com>
parents: 38894
diff changeset
365 } G_STMT_END
38893
ea7c40572374 Move migration to core, check for errors
qarkai <qarkai@gmail.com>
parents: 38045
diff changeset
366
ea7c40572374 Move migration to core, check for errors
qarkai <qarkai@gmail.com>
parents: 38045
diff changeset
367 gboolean
ea7c40572374 Move migration to core, check for errors
qarkai <qarkai@gmail.com>
parents: 38045
diff changeset
368 purple_core_migrate_to_xdg_base_dirs(void)
ea7c40572374 Move migration to core, check for errors
qarkai <qarkai@gmail.com>
parents: 38045
diff changeset
369 {
ea7c40572374 Move migration to core, check for errors
qarkai <qarkai@gmail.com>
parents: 38045
diff changeset
370 gboolean xdg_dir_exists;
ea7c40572374 Move migration to core, check for errors
qarkai <qarkai@gmail.com>
parents: 38045
diff changeset
371
ea7c40572374 Move migration to core, check for errors
qarkai <qarkai@gmail.com>
parents: 38045
diff changeset
372 xdg_dir_exists = g_file_test(purple_data_dir(), G_FILE_TEST_EXISTS);
ea7c40572374 Move migration to core, check for errors
qarkai <qarkai@gmail.com>
parents: 38045
diff changeset
373 if (!xdg_dir_exists) {
ea7c40572374 Move migration to core, check for errors
qarkai <qarkai@gmail.com>
parents: 38045
diff changeset
374 MIGRATE_TO_XDG_DIR(purple_data_dir(), "certificates");
39441
5cd3c1c79e7a Move custom smileys to XDG directories.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39438
diff changeset
375 MIGRATE_TO_XDG_DIR(purple_data_dir(), "custom_smiley");
38893
ea7c40572374 Move migration to core, check for errors
qarkai <qarkai@gmail.com>
parents: 38045
diff changeset
376 MIGRATE_TO_XDG_DIR(purple_data_dir(), "logs");
39438
e85334959b23 Move more libpurple files to ~/.config.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39406
diff changeset
377 MIGRATE_TO_XDG_DIR(purple_config_dir(), "accounts.xml");
e85334959b23 Move more libpurple files to ~/.config.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39406
diff changeset
378 MIGRATE_TO_XDG_DIR(purple_config_dir(), "blist.xml");
e85334959b23 Move more libpurple files to ~/.config.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39406
diff changeset
379 MIGRATE_TO_XDG_DIR(purple_config_dir(), "fs-codec.conf");
e85334959b23 Move more libpurple files to ~/.config.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39406
diff changeset
380 MIGRATE_TO_XDG_DIR(purple_config_dir(), "fs-element.conf");
e85334959b23 Move more libpurple files to ~/.config.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39406
diff changeset
381 MIGRATE_TO_XDG_DIR(purple_config_dir(), "prefs.xml");
39441
5cd3c1c79e7a Move custom smileys to XDG directories.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39438
diff changeset
382 MIGRATE_TO_XDG_DIR(purple_config_dir(), "smileys.xml");
39438
e85334959b23 Move more libpurple files to ~/.config.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39406
diff changeset
383 MIGRATE_TO_XDG_DIR(purple_config_dir(), "status.xml");
38893
ea7c40572374 Move migration to core, check for errors
qarkai <qarkai@gmail.com>
parents: 38045
diff changeset
384 }
ea7c40572374 Move migration to core, check for errors
qarkai <qarkai@gmail.com>
parents: 38045
diff changeset
385
ea7c40572374 Move migration to core, check for errors
qarkai <qarkai@gmail.com>
parents: 38045
diff changeset
386 return TRUE;
ea7c40572374 Move migration to core, check for errors
qarkai <qarkai@gmail.com>
parents: 38045
diff changeset
387 }

mercurial