Thu, 21 Jul 2022 01:10:22 -0500
Update pidgin for the purple_account_manager_get_(in)active deprecations
Testing Done:
Compiled and made sure the menus still functioned as expected.
Reviewed at https://reviews.imfreedom.org/r/1536/
|
20147
66f05a854eee
applied changes from 8a731bbd0197fbcc91a705c2d8f528154216defa
Richard Laager <rlaager@pidgin.im>
parents:
19859
diff
changeset
|
1 | /* pidgin |
| 5717 | 2 | * |
|
15931
716b5fac1895
Re-sed the copyright notices so they don't all talk about Purple.
Richard Laager <rlaager@pidgin.im>
parents:
15884
diff
changeset
|
3 | * Pidgin is the legal property of its developers, whose names are too numerous |
| 8046 | 4 | * to list here. Please refer to the COPYRIGHT file distributed with this |
| 5 | * source distribution. | |
| 5717 | 6 | * |
| 7 | * This program is free software; you can redistribute it and/or modify | |
| 8 | * it under the terms of the GNU General Public License as published by | |
| 9 | * the Free Software Foundation; either version 2 of the License, or | |
| 10 | * (at your option) any later version. | |
| 11 | * | |
| 12 | * This program is distributed in the hope that it will be useful, | |
| 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
| 15 | * GNU General Public License for more details. | |
| 16 | * | |
| 17 | * You should have received a copy of the GNU General Public License | |
| 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:
16752
diff
changeset
|
19 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA |
| 5717 | 20 | */ |
| 21 | ||
|
40360
e21f3bbcc2a5
Update all of the pidgin code to include purple.h
Gary Kramlich <grim@reaperworld.com>
parents:
35455
diff
changeset
|
22 | #include <purple.h> |
|
e21f3bbcc2a5
Update all of the pidgin code to include purple.h
Gary Kramlich <grim@reaperworld.com>
parents:
35455
diff
changeset
|
23 | |
|
34708
dd67596485ca
Undo renames of UI blist headers back to gntblist.h and gtkblist.h
Ankit Vani <a@nevitus.org>
parents:
34706
diff
changeset
|
24 | #include "gtkblist.h" |
|
12404
657afdf0f596
[gaim-migrate @ 14711]
Richard Laager <rlaager@pidgin.im>
parents:
12296
diff
changeset
|
25 | #include "gtkconn.h" |
|
657afdf0f596
[gaim-migrate @ 14711]
Richard Laager <rlaager@pidgin.im>
parents:
12296
diff
changeset
|
26 | #include "gtkdialogs.h" |
|
40496
6941fece679b
phase2 of pidgin.h: move existing file to pidgincore.h
Gary Kramlich <grim@reaperworld.com>
parents:
40443
diff
changeset
|
27 | #include "pidgincore.h" |
|
12404
657afdf0f596
[gaim-migrate @ 14711]
Richard Laager <rlaager@pidgin.im>
parents:
12296
diff
changeset
|
28 | #include "gtkutils.h" |
| 5717 | 29 | |
|
40412
c0905847d779
Use g_timeout_add_seconds some more.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
40360
diff
changeset
|
30 | #define INITIAL_RECON_DELAY_MIN 8 |
|
c0905847d779
Use g_timeout_add_seconds some more.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
40360
diff
changeset
|
31 | #define INITIAL_RECON_DELAY_MAX 60 |
| 14053 | 32 | |
|
40412
c0905847d779
Use g_timeout_add_seconds some more.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
40360
diff
changeset
|
33 | #define MAX_RECON_DELAY 600 |
|
20433
786f26a8dc6f
Make pidgin use report_disconnect_reason rather than report_disconnect, and
Will Thompson <resiak@pidgin.im>
parents:
19859
diff
changeset
|
34 | #define MAX_RACCOON_DELAY "shorter in urban areas" |
| 11523 | 35 | |
| 36 | typedef struct { | |
| 37 | int delay; | |
| 38 | guint timeout; | |
|
15883
969b74a3e27a
According to etags, pidgin/ should be completely clean of references to 'gaim' as a client
Sean Egan <seanegan@pidgin.im>
parents:
15577
diff
changeset
|
39 | } PidginAutoRecon; |
| 11523 | 40 | |
|
35455
216a37403c5b
Fix a bunch of gtk-doc warnings in pidgin
Ankit Vani <a@nevitus.org>
parents:
35454
diff
changeset
|
41 | /* |
|
13014
fa17f785b6fe
[gaim-migrate @ 15367]
Mark Doliner <markdoliner@pidgin.im>
parents:
13013
diff
changeset
|
42 | * Contains accounts that are auto-reconnecting. |
| 15884 | 43 | * The key is a pointer to the PurpleAccount and the |
|
15883
969b74a3e27a
According to etags, pidgin/ should be completely clean of references to 'gaim' as a client
Sean Egan <seanegan@pidgin.im>
parents:
15577
diff
changeset
|
44 | * value is a pointer to a PidginAutoRecon. |
|
13013
fde187d968dc
[gaim-migrate @ 15366]
Mark Doliner <markdoliner@pidgin.im>
parents:
12607
diff
changeset
|
45 | */ |
|
20341
a20de3c1c254
Rename Pidgin's hash table of ongoing autoreconnections to 'auto_reconns'
Will Thompson <resiak@pidgin.im>
parents:
20147
diff
changeset
|
46 | static GHashTable *auto_reconns = NULL; |
| 11523 | 47 | |
|
13014
fa17f785b6fe
[gaim-migrate @ 15367]
Mark Doliner <markdoliner@pidgin.im>
parents:
13013
diff
changeset
|
48 | static void |
| 15884 | 49 | pidgin_connection_connected(PurpleConnection *gc) |
| 5717 | 50 | { |
| 15884 | 51 | PurpleAccount *account; |
|
13014
fa17f785b6fe
[gaim-migrate @ 15367]
Mark Doliner <markdoliner@pidgin.im>
parents:
13013
diff
changeset
|
52 | |
| 15884 | 53 | account = purple_connection_get_account(gc); |
|
12607
4622f0adedf4
[gaim-migrate @ 14943]
Mark Doliner <markdoliner@pidgin.im>
parents:
12583
diff
changeset
|
54 | |
|
20341
a20de3c1c254
Rename Pidgin's hash table of ongoing autoreconnections to 'auto_reconns'
Will Thompson <resiak@pidgin.im>
parents:
20147
diff
changeset
|
55 | g_hash_table_remove(auto_reconns, account); |
| 5717 | 56 | } |
| 57 | ||
|
13014
fa17f785b6fe
[gaim-migrate @ 15367]
Mark Doliner <markdoliner@pidgin.im>
parents:
13013
diff
changeset
|
58 | static void |
| 15884 | 59 | pidgin_connection_disconnected(PurpleConnection *gc) |
| 5717 | 60 | { |
| 15884 | 61 | if (purple_connections_get_all() != NULL) |
|
5883
290fe1d16e60
[gaim-migrate @ 6315]
Christian Hammond <chipx86@chipx86.com>
parents:
5872
diff
changeset
|
62 | return; |
|
290fe1d16e60
[gaim-migrate @ 6315]
Christian Hammond <chipx86@chipx86.com>
parents:
5872
diff
changeset
|
63 | |
|
16263
27e0ef0f38e6
Word on the street is that we don't want things named pidginfoo_bar(), but
Richard Laager <rlaager@pidgin.im>
parents:
16254
diff
changeset
|
64 | pidgin_dialogs_destroy_all(); |
| 5717 | 65 | } |
| 66 | ||
|
13014
fa17f785b6fe
[gaim-migrate @ 15367]
Mark Doliner <markdoliner@pidgin.im>
parents:
13013
diff
changeset
|
67 | static void |
| 11523 | 68 | free_auto_recon(gpointer data) |
| 7493 | 69 | { |
|
15883
969b74a3e27a
According to etags, pidgin/ should be completely clean of references to 'gaim' as a client
Sean Egan <seanegan@pidgin.im>
parents:
15577
diff
changeset
|
70 | PidginAutoRecon *info = data; |
|
7912
b8f84918e7c1
[gaim-migrate @ 8573]
Mark Doliner <markdoliner@pidgin.im>
parents:
7890
diff
changeset
|
71 | |
| 11523 | 72 | if (info->timeout != 0) |
| 73 | g_source_remove(info->timeout); | |
|
7912
b8f84918e7c1
[gaim-migrate @ 8573]
Mark Doliner <markdoliner@pidgin.im>
parents:
7890
diff
changeset
|
74 | |
| 11523 | 75 | g_free(info); |
| 7493 | 76 | } |
| 77 | ||
| 11523 | 78 | static gboolean |
| 79 | do_signon(gpointer data) | |
|
7912
b8f84918e7c1
[gaim-migrate @ 8573]
Mark Doliner <markdoliner@pidgin.im>
parents:
7890
diff
changeset
|
80 | { |
| 15884 | 81 | PurpleAccount *account = data; |
|
15883
969b74a3e27a
According to etags, pidgin/ should be completely clean of references to 'gaim' as a client
Sean Egan <seanegan@pidgin.im>
parents:
15577
diff
changeset
|
82 | PidginAutoRecon *info; |
| 15884 | 83 | PurpleStatus *status; |
|
10916
3de20dd2dade
[gaim-migrate @ 12675]
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
10915
diff
changeset
|
84 | |
| 15884 | 85 | purple_debug_info("autorecon", "do_signon called\n"); |
| 11523 | 86 | g_return_val_if_fail(account != NULL, FALSE); |
|
20341
a20de3c1c254
Rename Pidgin's hash table of ongoing autoreconnections to 'auto_reconns'
Will Thompson <resiak@pidgin.im>
parents:
20147
diff
changeset
|
87 | info = g_hash_table_lookup(auto_reconns, account); |
|
7912
b8f84918e7c1
[gaim-migrate @ 8573]
Mark Doliner <markdoliner@pidgin.im>
parents:
7890
diff
changeset
|
88 | |
| 11523 | 89 | if (info) |
| 90 | info->timeout = 0; | |
|
7912
b8f84918e7c1
[gaim-migrate @ 8573]
Mark Doliner <markdoliner@pidgin.im>
parents:
7890
diff
changeset
|
91 | |
| 15884 | 92 | status = purple_account_get_active_status(account); |
| 93 | if (purple_status_is_online(status)) | |
|
13375
5ce3cb98de9f
[gaim-migrate @ 15747]
Mark Doliner <markdoliner@pidgin.im>
parents:
13129
diff
changeset
|
94 | { |
| 15884 | 95 | purple_debug_info("autorecon", "calling purple_account_connect\n"); |
| 96 | purple_account_connect(account); | |
| 97 | purple_debug_info("autorecon", "done calling purple_account_connect\n"); | |
|
13375
5ce3cb98de9f
[gaim-migrate @ 15747]
Mark Doliner <markdoliner@pidgin.im>
parents:
13129
diff
changeset
|
98 | } |
|
7912
b8f84918e7c1
[gaim-migrate @ 8573]
Mark Doliner <markdoliner@pidgin.im>
parents:
7890
diff
changeset
|
99 | |
| 11523 | 100 | return FALSE; |
|
7912
b8f84918e7c1
[gaim-migrate @ 8573]
Mark Doliner <markdoliner@pidgin.im>
parents:
7890
diff
changeset
|
101 | } |
|
b8f84918e7c1
[gaim-migrate @ 8573]
Mark Doliner <markdoliner@pidgin.im>
parents:
7890
diff
changeset
|
102 | |
|
13014
fa17f785b6fe
[gaim-migrate @ 15367]
Mark Doliner <markdoliner@pidgin.im>
parents:
13013
diff
changeset
|
103 | static void |
|
32153
121f15699f88
Rename the report_disconnect_reason cb function to report_disconnect
Mark Doliner <markdoliner@pidgin.im>
parents:
32152
diff
changeset
|
104 | pidgin_connection_report_disconnect(PurpleConnection *gc, |
|
121f15699f88
Rename the report_disconnect_reason cb function to report_disconnect
Mark Doliner <markdoliner@pidgin.im>
parents:
32152
diff
changeset
|
105 | PurpleConnectionError reason, |
|
121f15699f88
Rename the report_disconnect_reason cb function to report_disconnect
Mark Doliner <markdoliner@pidgin.im>
parents:
32152
diff
changeset
|
106 | const char *text) |
| 7399 | 107 | { |
| 15884 | 108 | PurpleAccount *account = NULL; |
|
15883
969b74a3e27a
According to etags, pidgin/ should be completely clean of references to 'gaim' as a client
Sean Egan <seanegan@pidgin.im>
parents:
15577
diff
changeset
|
109 | PidginAutoRecon *info; |
| 7808 | 110 | |
| 15884 | 111 | account = purple_connection_get_account(gc); |
|
20341
a20de3c1c254
Rename Pidgin's hash table of ongoing autoreconnections to 'auto_reconns'
Will Thompson <resiak@pidgin.im>
parents:
20147
diff
changeset
|
112 | info = g_hash_table_lookup(auto_reconns, account); |
|
7912
b8f84918e7c1
[gaim-migrate @ 8573]
Mark Doliner <markdoliner@pidgin.im>
parents:
7890
diff
changeset
|
113 | |
| 21279 | 114 | if (!purple_connection_error_is_fatal (reason)) { |
|
12009
06852325c88f
[gaim-migrate @ 14302]
Mark Doliner <markdoliner@pidgin.im>
parents:
11721
diff
changeset
|
115 | if (info == NULL) { |
|
15883
969b74a3e27a
According to etags, pidgin/ should be completely clean of references to 'gaim' as a client
Sean Egan <seanegan@pidgin.im>
parents:
15577
diff
changeset
|
116 | info = g_new0(PidginAutoRecon, 1); |
|
20341
a20de3c1c254
Rename Pidgin's hash table of ongoing autoreconnections to 'auto_reconns'
Will Thompson <resiak@pidgin.im>
parents:
20147
diff
changeset
|
117 | g_hash_table_insert(auto_reconns, account, info); |
| 14053 | 118 | info->delay = g_random_int_range(INITIAL_RECON_DELAY_MIN, INITIAL_RECON_DELAY_MAX); |
|
7483
08237091e8a5
[gaim-migrate @ 8096]
Mark Doliner <markdoliner@pidgin.im>
parents:
7431
diff
changeset
|
119 | } else { |
| 11523 | 120 | info->delay = MIN(2 * info->delay, MAX_RECON_DELAY); |
| 121 | if (info->timeout != 0) | |
| 122 | g_source_remove(info->timeout); | |
|
7483
08237091e8a5
[gaim-migrate @ 8096]
Mark Doliner <markdoliner@pidgin.im>
parents:
7431
diff
changeset
|
123 | } |
|
40412
c0905847d779
Use g_timeout_add_seconds some more.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
40360
diff
changeset
|
124 | info->timeout = g_timeout_add_seconds(info->delay, do_signon, account); |
| 11559 | 125 | } else { |
|
13014
fa17f785b6fe
[gaim-migrate @ 15367]
Mark Doliner <markdoliner@pidgin.im>
parents:
13013
diff
changeset
|
126 | if (info != NULL) |
|
20341
a20de3c1c254
Rename Pidgin's hash table of ongoing autoreconnections to 'auto_reconns'
Will Thompson <resiak@pidgin.im>
parents:
20147
diff
changeset
|
127 | g_hash_table_remove(auto_reconns, account); |
|
11721
c74083492667
[gaim-migrate @ 14012]
Mark Doliner <markdoliner@pidgin.im>
parents:
11638
diff
changeset
|
128 | |
|
41392
b5c84f55d5d2
Remove the ui parameter from purple_account_[gs]et_enabled
Gary Kramlich <grim@reaperworld.com>
parents:
41320
diff
changeset
|
129 | purple_account_set_enabled(account, FALSE); |
| 7399 | 130 | } |
| 131 | } | |
| 132 | ||
|
41209
909561f42b1f
port Pidgin to the new PurpleAccountManager api
Gary Kramlich <grim@reaperworld.com>
parents:
41087
diff
changeset
|
133 | static void |
|
909561f42b1f
port Pidgin to the new PurpleAccountManager api
Gary Kramlich <grim@reaperworld.com>
parents:
41087
diff
changeset
|
134 | pidgin_connection_network_connected(void) { |
|
909561f42b1f
port Pidgin to the new PurpleAccountManager api
Gary Kramlich <grim@reaperworld.com>
parents:
41087
diff
changeset
|
135 | PurpleAccountManager *manager = NULL; |
|
909561f42b1f
port Pidgin to the new PurpleAccountManager api
Gary Kramlich <grim@reaperworld.com>
parents:
41087
diff
changeset
|
136 | GList *l = NULL; |
| 14767 | 137 | |
|
41209
909561f42b1f
port Pidgin to the new PurpleAccountManager api
Gary Kramlich <grim@reaperworld.com>
parents:
41087
diff
changeset
|
138 | manager = purple_account_manager_get_default(); |
|
41454
7cc69bde919d
Update pidgin for the purple_account_manager_get_(in)active deprecations
Gary Kramlich <grim@reaperworld.com>
parents:
41392
diff
changeset
|
139 | l = purple_account_manager_get_enabled(manager); |
|
41209
909561f42b1f
port Pidgin to the new PurpleAccountManager api
Gary Kramlich <grim@reaperworld.com>
parents:
41087
diff
changeset
|
140 | |
|
909561f42b1f
port Pidgin to the new PurpleAccountManager api
Gary Kramlich <grim@reaperworld.com>
parents:
41087
diff
changeset
|
141 | while(l != NULL) { |
|
21942
8ee08ef6b2a3
Fix a GList being leaked when dealing with network connection/disconnection events.
Daniel Atallah <datallah@pidgin.im>
parents:
21512
diff
changeset
|
142 | PurpleAccount *account = (PurpleAccount*)l->data; |
|
20341
a20de3c1c254
Rename Pidgin's hash table of ongoing autoreconnections to 'auto_reconns'
Will Thompson <resiak@pidgin.im>
parents:
20147
diff
changeset
|
143 | g_hash_table_remove(auto_reconns, account); |
| 15884 | 144 | if (purple_account_is_disconnected(account)) |
|
14784
3a82321f46f2
[gaim-migrate @ 17476]
Daniel Atallah <datallah@pidgin.im>
parents:
14767
diff
changeset
|
145 | do_signon(account); |
|
41209
909561f42b1f
port Pidgin to the new PurpleAccountManager api
Gary Kramlich <grim@reaperworld.com>
parents:
41087
diff
changeset
|
146 | |
|
909561f42b1f
port Pidgin to the new PurpleAccountManager api
Gary Kramlich <grim@reaperworld.com>
parents:
41087
diff
changeset
|
147 | l = g_list_delete_link(l, l); |
| 14767 | 148 | } |
| 14758 | 149 | } |
| 150 | ||
|
41209
909561f42b1f
port Pidgin to the new PurpleAccountManager api
Gary Kramlich <grim@reaperworld.com>
parents:
41087
diff
changeset
|
151 | static void |
|
909561f42b1f
port Pidgin to the new PurpleAccountManager api
Gary Kramlich <grim@reaperworld.com>
parents:
41087
diff
changeset
|
152 | pidgin_connection_network_disconnected(void) { |
|
909561f42b1f
port Pidgin to the new PurpleAccountManager api
Gary Kramlich <grim@reaperworld.com>
parents:
41087
diff
changeset
|
153 | PurpleAccountManager *manager = NULL; |
|
909561f42b1f
port Pidgin to the new PurpleAccountManager api
Gary Kramlich <grim@reaperworld.com>
parents:
41087
diff
changeset
|
154 | GList *l = NULL; |
| 14767 | 155 | |
|
41209
909561f42b1f
port Pidgin to the new PurpleAccountManager api
Gary Kramlich <grim@reaperworld.com>
parents:
41087
diff
changeset
|
156 | manager = purple_account_manager_get_default(); |
|
41454
7cc69bde919d
Update pidgin for the purple_account_manager_get_(in)active deprecations
Gary Kramlich <grim@reaperworld.com>
parents:
41392
diff
changeset
|
157 | l = purple_account_manager_get_enabled(manager); |
|
41209
909561f42b1f
port Pidgin to the new PurpleAccountManager api
Gary Kramlich <grim@reaperworld.com>
parents:
41087
diff
changeset
|
158 | |
|
909561f42b1f
port Pidgin to the new PurpleAccountManager api
Gary Kramlich <grim@reaperworld.com>
parents:
41087
diff
changeset
|
159 | while(l != NULL) { |
| 15884 | 160 | PurpleAccount *a = (PurpleAccount*)l->data; |
| 161 | if (!purple_account_is_disconnected(a)) { | |
|
24519
d4af3d043211
Improve our NetworkManager support in a couple of ways:
Richard Laager <rlaager@pidgin.im>
parents:
24414
diff
changeset
|
162 | purple_account_disconnect(a); |
| 15090 | 163 | } |
|
41209
909561f42b1f
port Pidgin to the new PurpleAccountManager api
Gary Kramlich <grim@reaperworld.com>
parents:
41087
diff
changeset
|
164 | |
|
909561f42b1f
port Pidgin to the new PurpleAccountManager api
Gary Kramlich <grim@reaperworld.com>
parents:
41087
diff
changeset
|
165 | l = g_list_delete_link(l, l); |
| 14758 | 166 | } |
| 167 | } | |
| 168 | ||
| 15884 | 169 | static void pidgin_connection_notice(PurpleConnection *gc, const char *text) |
| 14758 | 170 | { } |
| 171 | ||
| 15884 | 172 | static PurpleConnectionUiOps conn_ui_ops = |
| 5717 | 173 | { |
|
41228
cfabfc1afd50
Make PidginStatusBox manage its own connecting state.
Gary Kramlich <grim@reaperworld.com>
parents:
41209
diff
changeset
|
174 | NULL, |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15442
diff
changeset
|
175 | pidgin_connection_connected, |
|
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15442
diff
changeset
|
176 | pidgin_connection_disconnected, |
|
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15442
diff
changeset
|
177 | pidgin_connection_notice, |
|
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15442
diff
changeset
|
178 | pidgin_connection_network_connected, |
|
16752
e6bcb1628c57
Patch from John 'rekkanoryo' Bailey to add the padding struct members in pidgin
Gary Kramlich <grim@reaperworld.com>
parents:
16263
diff
changeset
|
179 | pidgin_connection_network_disconnected, |
|
32153
121f15699f88
Rename the report_disconnect_reason cb function to report_disconnect
Mark Doliner <markdoliner@pidgin.im>
parents:
32152
diff
changeset
|
180 | pidgin_connection_report_disconnect, |
|
16752
e6bcb1628c57
Patch from John 'rekkanoryo' Bailey to add the padding struct members in pidgin
Gary Kramlich <grim@reaperworld.com>
parents:
16263
diff
changeset
|
181 | NULL, |
|
e6bcb1628c57
Patch from John 'rekkanoryo' Bailey to add the padding struct members in pidgin
Gary Kramlich <grim@reaperworld.com>
parents:
16263
diff
changeset
|
182 | NULL, |
|
34906
6f5e8a7bfe8c
Initialized new padding member in connection UI ops
Ankit Vani <a@nevitus.org>
parents:
34708
diff
changeset
|
183 | NULL, |
|
16752
e6bcb1628c57
Patch from John 'rekkanoryo' Bailey to add the padding struct members in pidgin
Gary Kramlich <grim@reaperworld.com>
parents:
16263
diff
changeset
|
184 | NULL |
| 5717 | 185 | }; |
| 186 | ||
| 15884 | 187 | PurpleConnectionUiOps * |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15442
diff
changeset
|
188 | pidgin_connections_get_ui_ops(void) |
| 5717 | 189 | { |
| 190 | return &conn_ui_ops; | |
| 191 | } | |
|
13014
fa17f785b6fe
[gaim-migrate @ 15367]
Mark Doliner <markdoliner@pidgin.im>
parents:
13013
diff
changeset
|
192 | |
|
fa17f785b6fe
[gaim-migrate @ 15367]
Mark Doliner <markdoliner@pidgin.im>
parents:
13013
diff
changeset
|
193 | static void |
| 15884 | 194 | account_removed_cb(PurpleAccount *account, gpointer user_data) |
|
13014
fa17f785b6fe
[gaim-migrate @ 15367]
Mark Doliner <markdoliner@pidgin.im>
parents:
13013
diff
changeset
|
195 | { |
|
20341
a20de3c1c254
Rename Pidgin's hash table of ongoing autoreconnections to 'auto_reconns'
Will Thompson <resiak@pidgin.im>
parents:
20147
diff
changeset
|
196 | g_hash_table_remove(auto_reconns, account); |
|
13014
fa17f785b6fe
[gaim-migrate @ 15367]
Mark Doliner <markdoliner@pidgin.im>
parents:
13013
diff
changeset
|
197 | } |
|
fa17f785b6fe
[gaim-migrate @ 15367]
Mark Doliner <markdoliner@pidgin.im>
parents:
13013
diff
changeset
|
198 | |
|
fa17f785b6fe
[gaim-migrate @ 15367]
Mark Doliner <markdoliner@pidgin.im>
parents:
13013
diff
changeset
|
199 | |
|
fa17f785b6fe
[gaim-migrate @ 15367]
Mark Doliner <markdoliner@pidgin.im>
parents:
13013
diff
changeset
|
200 | /************************************************************************** |
|
41087
4fc5b0ddf55e
Remove the + from GTK
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
41012
diff
changeset
|
201 | * GTK connection glue |
|
13014
fa17f785b6fe
[gaim-migrate @ 15367]
Mark Doliner <markdoliner@pidgin.im>
parents:
13013
diff
changeset
|
202 | **************************************************************************/ |
|
fa17f785b6fe
[gaim-migrate @ 15367]
Mark Doliner <markdoliner@pidgin.im>
parents:
13013
diff
changeset
|
203 | |
|
fa17f785b6fe
[gaim-migrate @ 15367]
Mark Doliner <markdoliner@pidgin.im>
parents:
13013
diff
changeset
|
204 | void * |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15442
diff
changeset
|
205 | pidgin_connection_get_handle(void) |
|
13014
fa17f785b6fe
[gaim-migrate @ 15367]
Mark Doliner <markdoliner@pidgin.im>
parents:
13013
diff
changeset
|
206 | { |
|
fa17f785b6fe
[gaim-migrate @ 15367]
Mark Doliner <markdoliner@pidgin.im>
parents:
13013
diff
changeset
|
207 | static int handle; |
|
fa17f785b6fe
[gaim-migrate @ 15367]
Mark Doliner <markdoliner@pidgin.im>
parents:
13013
diff
changeset
|
208 | |
|
fa17f785b6fe
[gaim-migrate @ 15367]
Mark Doliner <markdoliner@pidgin.im>
parents:
13013
diff
changeset
|
209 | return &handle; |
|
fa17f785b6fe
[gaim-migrate @ 15367]
Mark Doliner <markdoliner@pidgin.im>
parents:
13013
diff
changeset
|
210 | } |
|
fa17f785b6fe
[gaim-migrate @ 15367]
Mark Doliner <markdoliner@pidgin.im>
parents:
13013
diff
changeset
|
211 | |
|
fa17f785b6fe
[gaim-migrate @ 15367]
Mark Doliner <markdoliner@pidgin.im>
parents:
13013
diff
changeset
|
212 | void |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15442
diff
changeset
|
213 | pidgin_connection_init(void) |
|
13014
fa17f785b6fe
[gaim-migrate @ 15367]
Mark Doliner <markdoliner@pidgin.im>
parents:
13013
diff
changeset
|
214 | { |
|
20341
a20de3c1c254
Rename Pidgin's hash table of ongoing autoreconnections to 'auto_reconns'
Will Thompson <resiak@pidgin.im>
parents:
20147
diff
changeset
|
215 | auto_reconns = g_hash_table_new_full( |
|
13014
fa17f785b6fe
[gaim-migrate @ 15367]
Mark Doliner <markdoliner@pidgin.im>
parents:
13013
diff
changeset
|
216 | g_direct_hash, g_direct_equal, |
|
fa17f785b6fe
[gaim-migrate @ 15367]
Mark Doliner <markdoliner@pidgin.im>
parents:
13013
diff
changeset
|
217 | NULL, free_auto_recon); |
|
fa17f785b6fe
[gaim-migrate @ 15367]
Mark Doliner <markdoliner@pidgin.im>
parents:
13013
diff
changeset
|
218 | |
| 15884 | 219 | purple_signal_connect(purple_accounts_get_handle(), "account-removed", |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15442
diff
changeset
|
220 | pidgin_connection_get_handle(), |
|
41314
0dc72eacd8bf
Replace PURPLE_CALLBACK by G_CALLBACK
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
41228
diff
changeset
|
221 | G_CALLBACK(account_removed_cb), NULL); |
|
13014
fa17f785b6fe
[gaim-migrate @ 15367]
Mark Doliner <markdoliner@pidgin.im>
parents:
13013
diff
changeset
|
222 | } |
|
fa17f785b6fe
[gaim-migrate @ 15367]
Mark Doliner <markdoliner@pidgin.im>
parents:
13013
diff
changeset
|
223 | |
|
fa17f785b6fe
[gaim-migrate @ 15367]
Mark Doliner <markdoliner@pidgin.im>
parents:
13013
diff
changeset
|
224 | void |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15442
diff
changeset
|
225 | pidgin_connection_uninit(void) |
|
13014
fa17f785b6fe
[gaim-migrate @ 15367]
Mark Doliner <markdoliner@pidgin.im>
parents:
13013
diff
changeset
|
226 | { |
| 15884 | 227 | purple_signals_disconnect_by_handle(pidgin_connection_get_handle()); |
|
13014
fa17f785b6fe
[gaim-migrate @ 15367]
Mark Doliner <markdoliner@pidgin.im>
parents:
13013
diff
changeset
|
228 | |
|
20341
a20de3c1c254
Rename Pidgin's hash table of ongoing autoreconnections to 'auto_reconns'
Will Thompson <resiak@pidgin.im>
parents:
20147
diff
changeset
|
229 | g_hash_table_destroy(auto_reconns); |
|
13014
fa17f785b6fe
[gaim-migrate @ 15367]
Mark Doliner <markdoliner@pidgin.im>
parents:
13013
diff
changeset
|
230 | } |