Sun, 09 Oct 2022 01:48:50 -0500
Use PurpleAccountManager added/removed signals
Testing Done:
Opened Pidgin and made sure there were no warnings about objects not existing in time for the new signal connections.
Opened XMPP console and saw that the drop down updated when an XMPP account was added/removed.
Reviewed at https://reviews.imfreedom.org/r/1913/
|
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; |
| 5717 | 63 | } |
| 64 | ||
|
13014
fa17f785b6fe
[gaim-migrate @ 15367]
Mark Doliner <markdoliner@pidgin.im>
parents:
13013
diff
changeset
|
65 | static void |
| 11523 | 66 | free_auto_recon(gpointer data) |
| 7493 | 67 | { |
|
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
|
68 | PidginAutoRecon *info = data; |
|
7912
b8f84918e7c1
[gaim-migrate @ 8573]
Mark Doliner <markdoliner@pidgin.im>
parents:
7890
diff
changeset
|
69 | |
| 11523 | 70 | if (info->timeout != 0) |
| 71 | g_source_remove(info->timeout); | |
|
7912
b8f84918e7c1
[gaim-migrate @ 8573]
Mark Doliner <markdoliner@pidgin.im>
parents:
7890
diff
changeset
|
72 | |
| 11523 | 73 | g_free(info); |
| 7493 | 74 | } |
| 75 | ||
| 11523 | 76 | static gboolean |
| 77 | do_signon(gpointer data) | |
|
7912
b8f84918e7c1
[gaim-migrate @ 8573]
Mark Doliner <markdoliner@pidgin.im>
parents:
7890
diff
changeset
|
78 | { |
| 15884 | 79 | 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
|
80 | PidginAutoRecon *info; |
| 15884 | 81 | PurpleStatus *status; |
|
10916
3de20dd2dade
[gaim-migrate @ 12675]
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
10915
diff
changeset
|
82 | |
| 15884 | 83 | purple_debug_info("autorecon", "do_signon called\n"); |
| 11523 | 84 | 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
|
85 | info = g_hash_table_lookup(auto_reconns, account); |
|
7912
b8f84918e7c1
[gaim-migrate @ 8573]
Mark Doliner <markdoliner@pidgin.im>
parents:
7890
diff
changeset
|
86 | |
| 11523 | 87 | if (info) |
| 88 | info->timeout = 0; | |
|
7912
b8f84918e7c1
[gaim-migrate @ 8573]
Mark Doliner <markdoliner@pidgin.im>
parents:
7890
diff
changeset
|
89 | |
| 15884 | 90 | status = purple_account_get_active_status(account); |
| 91 | if (purple_status_is_online(status)) | |
|
13375
5ce3cb98de9f
[gaim-migrate @ 15747]
Mark Doliner <markdoliner@pidgin.im>
parents:
13129
diff
changeset
|
92 | { |
| 15884 | 93 | purple_debug_info("autorecon", "calling purple_account_connect\n"); |
| 94 | purple_account_connect(account); | |
| 95 | purple_debug_info("autorecon", "done calling purple_account_connect\n"); | |
|
13375
5ce3cb98de9f
[gaim-migrate @ 15747]
Mark Doliner <markdoliner@pidgin.im>
parents:
13129
diff
changeset
|
96 | } |
|
7912
b8f84918e7c1
[gaim-migrate @ 8573]
Mark Doliner <markdoliner@pidgin.im>
parents:
7890
diff
changeset
|
97 | |
| 11523 | 98 | return FALSE; |
|
7912
b8f84918e7c1
[gaim-migrate @ 8573]
Mark Doliner <markdoliner@pidgin.im>
parents:
7890
diff
changeset
|
99 | } |
|
b8f84918e7c1
[gaim-migrate @ 8573]
Mark Doliner <markdoliner@pidgin.im>
parents:
7890
diff
changeset
|
100 | |
|
13014
fa17f785b6fe
[gaim-migrate @ 15367]
Mark Doliner <markdoliner@pidgin.im>
parents:
13013
diff
changeset
|
101 | static void |
|
32153
121f15699f88
Rename the report_disconnect_reason cb function to report_disconnect
Mark Doliner <markdoliner@pidgin.im>
parents:
32152
diff
changeset
|
102 | 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
|
103 | PurpleConnectionError reason, |
|
121f15699f88
Rename the report_disconnect_reason cb function to report_disconnect
Mark Doliner <markdoliner@pidgin.im>
parents:
32152
diff
changeset
|
104 | const char *text) |
| 7399 | 105 | { |
| 15884 | 106 | 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
|
107 | PidginAutoRecon *info; |
| 7808 | 108 | |
| 15884 | 109 | 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
|
110 | info = g_hash_table_lookup(auto_reconns, account); |
|
7912
b8f84918e7c1
[gaim-migrate @ 8573]
Mark Doliner <markdoliner@pidgin.im>
parents:
7890
diff
changeset
|
111 | |
| 21279 | 112 | if (!purple_connection_error_is_fatal (reason)) { |
|
12009
06852325c88f
[gaim-migrate @ 14302]
Mark Doliner <markdoliner@pidgin.im>
parents:
11721
diff
changeset
|
113 | 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
|
114 | 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
|
115 | g_hash_table_insert(auto_reconns, account, info); |
| 14053 | 116 | 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
|
117 | } else { |
| 11523 | 118 | info->delay = MIN(2 * info->delay, MAX_RECON_DELAY); |
| 119 | if (info->timeout != 0) | |
| 120 | g_source_remove(info->timeout); | |
|
7483
08237091e8a5
[gaim-migrate @ 8096]
Mark Doliner <markdoliner@pidgin.im>
parents:
7431
diff
changeset
|
121 | } |
|
40412
c0905847d779
Use g_timeout_add_seconds some more.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
40360
diff
changeset
|
122 | info->timeout = g_timeout_add_seconds(info->delay, do_signon, account); |
| 11559 | 123 | } else { |
|
13014
fa17f785b6fe
[gaim-migrate @ 15367]
Mark Doliner <markdoliner@pidgin.im>
parents:
13013
diff
changeset
|
124 | 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
|
125 | g_hash_table_remove(auto_reconns, account); |
|
11721
c74083492667
[gaim-migrate @ 14012]
Mark Doliner <markdoliner@pidgin.im>
parents:
11638
diff
changeset
|
126 | |
|
41392
b5c84f55d5d2
Remove the ui parameter from purple_account_[gs]et_enabled
Gary Kramlich <grim@reaperworld.com>
parents:
41320
diff
changeset
|
127 | purple_account_set_enabled(account, FALSE); |
| 7399 | 128 | } |
| 129 | } | |
| 130 | ||
|
41209
909561f42b1f
port Pidgin to the new PurpleAccountManager api
Gary Kramlich <grim@reaperworld.com>
parents:
41087
diff
changeset
|
131 | static void |
|
909561f42b1f
port Pidgin to the new PurpleAccountManager api
Gary Kramlich <grim@reaperworld.com>
parents:
41087
diff
changeset
|
132 | pidgin_connection_network_connected(void) { |
|
909561f42b1f
port Pidgin to the new PurpleAccountManager api
Gary Kramlich <grim@reaperworld.com>
parents:
41087
diff
changeset
|
133 | PurpleAccountManager *manager = NULL; |
|
909561f42b1f
port Pidgin to the new PurpleAccountManager api
Gary Kramlich <grim@reaperworld.com>
parents:
41087
diff
changeset
|
134 | GList *l = NULL; |
| 14767 | 135 | |
|
41209
909561f42b1f
port Pidgin to the new PurpleAccountManager api
Gary Kramlich <grim@reaperworld.com>
parents:
41087
diff
changeset
|
136 | 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
|
137 | 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
|
138 | |
|
909561f42b1f
port Pidgin to the new PurpleAccountManager api
Gary Kramlich <grim@reaperworld.com>
parents:
41087
diff
changeset
|
139 | 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
|
140 | 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
|
141 | g_hash_table_remove(auto_reconns, account); |
| 15884 | 142 | if (purple_account_is_disconnected(account)) |
|
14784
3a82321f46f2
[gaim-migrate @ 17476]
Daniel Atallah <datallah@pidgin.im>
parents:
14767
diff
changeset
|
143 | do_signon(account); |
|
41209
909561f42b1f
port Pidgin to the new PurpleAccountManager api
Gary Kramlich <grim@reaperworld.com>
parents:
41087
diff
changeset
|
144 | |
|
909561f42b1f
port Pidgin to the new PurpleAccountManager api
Gary Kramlich <grim@reaperworld.com>
parents:
41087
diff
changeset
|
145 | l = g_list_delete_link(l, l); |
| 14767 | 146 | } |
| 14758 | 147 | } |
| 148 | ||
|
41209
909561f42b1f
port Pidgin to the new PurpleAccountManager api
Gary Kramlich <grim@reaperworld.com>
parents:
41087
diff
changeset
|
149 | static void |
|
909561f42b1f
port Pidgin to the new PurpleAccountManager api
Gary Kramlich <grim@reaperworld.com>
parents:
41087
diff
changeset
|
150 | pidgin_connection_network_disconnected(void) { |
|
909561f42b1f
port Pidgin to the new PurpleAccountManager api
Gary Kramlich <grim@reaperworld.com>
parents:
41087
diff
changeset
|
151 | PurpleAccountManager *manager = NULL; |
|
909561f42b1f
port Pidgin to the new PurpleAccountManager api
Gary Kramlich <grim@reaperworld.com>
parents:
41087
diff
changeset
|
152 | GList *l = NULL; |
| 14767 | 153 | |
|
41209
909561f42b1f
port Pidgin to the new PurpleAccountManager api
Gary Kramlich <grim@reaperworld.com>
parents:
41087
diff
changeset
|
154 | 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
|
155 | 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
|
156 | |
|
909561f42b1f
port Pidgin to the new PurpleAccountManager api
Gary Kramlich <grim@reaperworld.com>
parents:
41087
diff
changeset
|
157 | while(l != NULL) { |
| 15884 | 158 | PurpleAccount *a = (PurpleAccount*)l->data; |
| 159 | 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
|
160 | purple_account_disconnect(a); |
| 15090 | 161 | } |
|
41209
909561f42b1f
port Pidgin to the new PurpleAccountManager api
Gary Kramlich <grim@reaperworld.com>
parents:
41087
diff
changeset
|
162 | |
|
909561f42b1f
port Pidgin to the new PurpleAccountManager api
Gary Kramlich <grim@reaperworld.com>
parents:
41087
diff
changeset
|
163 | l = g_list_delete_link(l, l); |
| 14758 | 164 | } |
| 165 | } | |
| 166 | ||
|
41716
61b1b01b8de4
Use struct intializers for PurpleConnectionUiOps
Gary Kramlich <grim@reaperworld.com>
parents:
41715
diff
changeset
|
167 | static PurpleConnectionUiOps conn_ui_ops = { |
|
61b1b01b8de4
Use struct intializers for PurpleConnectionUiOps
Gary Kramlich <grim@reaperworld.com>
parents:
41715
diff
changeset
|
168 | .connected = pidgin_connection_connected, |
|
61b1b01b8de4
Use struct intializers for PurpleConnectionUiOps
Gary Kramlich <grim@reaperworld.com>
parents:
41715
diff
changeset
|
169 | .disconnected = pidgin_connection_disconnected, |
|
61b1b01b8de4
Use struct intializers for PurpleConnectionUiOps
Gary Kramlich <grim@reaperworld.com>
parents:
41715
diff
changeset
|
170 | .network_connected = pidgin_connection_network_connected, |
|
61b1b01b8de4
Use struct intializers for PurpleConnectionUiOps
Gary Kramlich <grim@reaperworld.com>
parents:
41715
diff
changeset
|
171 | .network_disconnected = pidgin_connection_network_disconnected, |
|
61b1b01b8de4
Use struct intializers for PurpleConnectionUiOps
Gary Kramlich <grim@reaperworld.com>
parents:
41715
diff
changeset
|
172 | .report_disconnect = pidgin_connection_report_disconnect, |
| 5717 | 173 | }; |
| 174 | ||
| 15884 | 175 | PurpleConnectionUiOps * |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15442
diff
changeset
|
176 | pidgin_connections_get_ui_ops(void) |
| 5717 | 177 | { |
| 178 | return &conn_ui_ops; | |
| 179 | } | |
|
13014
fa17f785b6fe
[gaim-migrate @ 15367]
Mark Doliner <markdoliner@pidgin.im>
parents:
13013
diff
changeset
|
180 | |
|
fa17f785b6fe
[gaim-migrate @ 15367]
Mark Doliner <markdoliner@pidgin.im>
parents:
13013
diff
changeset
|
181 | static void |
|
41797
3bc9948e9f3c
Use PurpleAccountManager added/removed signals
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
41716
diff
changeset
|
182 | account_removed_cb(G_GNUC_UNUSED PurpleAccountManager *manager, |
|
3bc9948e9f3c
Use PurpleAccountManager added/removed signals
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
41716
diff
changeset
|
183 | PurpleAccount *account, G_GNUC_UNUSED gpointer data) |
|
13014
fa17f785b6fe
[gaim-migrate @ 15367]
Mark Doliner <markdoliner@pidgin.im>
parents:
13013
diff
changeset
|
184 | { |
|
20341
a20de3c1c254
Rename Pidgin's hash table of ongoing autoreconnections to 'auto_reconns'
Will Thompson <resiak@pidgin.im>
parents:
20147
diff
changeset
|
185 | g_hash_table_remove(auto_reconns, account); |
|
13014
fa17f785b6fe
[gaim-migrate @ 15367]
Mark Doliner <markdoliner@pidgin.im>
parents:
13013
diff
changeset
|
186 | } |
|
fa17f785b6fe
[gaim-migrate @ 15367]
Mark Doliner <markdoliner@pidgin.im>
parents:
13013
diff
changeset
|
187 | |
|
fa17f785b6fe
[gaim-migrate @ 15367]
Mark Doliner <markdoliner@pidgin.im>
parents:
13013
diff
changeset
|
188 | |
|
fa17f785b6fe
[gaim-migrate @ 15367]
Mark Doliner <markdoliner@pidgin.im>
parents:
13013
diff
changeset
|
189 | /************************************************************************** |
|
41087
4fc5b0ddf55e
Remove the + from GTK
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
41012
diff
changeset
|
190 | * GTK connection glue |
|
13014
fa17f785b6fe
[gaim-migrate @ 15367]
Mark Doliner <markdoliner@pidgin.im>
parents:
13013
diff
changeset
|
191 | **************************************************************************/ |
|
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 | void |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15442
diff
changeset
|
194 | pidgin_connection_init(void) |
|
13014
fa17f785b6fe
[gaim-migrate @ 15367]
Mark Doliner <markdoliner@pidgin.im>
parents:
13013
diff
changeset
|
195 | { |
|
41797
3bc9948e9f3c
Use PurpleAccountManager added/removed signals
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
41716
diff
changeset
|
196 | PurpleAccountManager *manager = purple_account_manager_get_default(); |
|
3bc9948e9f3c
Use PurpleAccountManager added/removed signals
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
41716
diff
changeset
|
197 | |
|
20341
a20de3c1c254
Rename Pidgin's hash table of ongoing autoreconnections to 'auto_reconns'
Will Thompson <resiak@pidgin.im>
parents:
20147
diff
changeset
|
198 | auto_reconns = g_hash_table_new_full( |
|
13014
fa17f785b6fe
[gaim-migrate @ 15367]
Mark Doliner <markdoliner@pidgin.im>
parents:
13013
diff
changeset
|
199 | g_direct_hash, g_direct_equal, |
|
fa17f785b6fe
[gaim-migrate @ 15367]
Mark Doliner <markdoliner@pidgin.im>
parents:
13013
diff
changeset
|
200 | NULL, free_auto_recon); |
|
fa17f785b6fe
[gaim-migrate @ 15367]
Mark Doliner <markdoliner@pidgin.im>
parents:
13013
diff
changeset
|
201 | |
|
41797
3bc9948e9f3c
Use PurpleAccountManager added/removed signals
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
41716
diff
changeset
|
202 | g_signal_connect(manager, "removed", G_CALLBACK(account_removed_cb), NULL); |
|
13014
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 | |
|
fa17f785b6fe
[gaim-migrate @ 15367]
Mark Doliner <markdoliner@pidgin.im>
parents:
13013
diff
changeset
|
205 | void |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15442
diff
changeset
|
206 | pidgin_connection_uninit(void) |
|
13014
fa17f785b6fe
[gaim-migrate @ 15367]
Mark Doliner <markdoliner@pidgin.im>
parents:
13013
diff
changeset
|
207 | { |
|
41797
3bc9948e9f3c
Use PurpleAccountManager added/removed signals
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
41716
diff
changeset
|
208 | PurpleAccountManager *manager = purple_account_manager_get_default(); |
|
3bc9948e9f3c
Use PurpleAccountManager added/removed signals
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
41716
diff
changeset
|
209 | |
|
3bc9948e9f3c
Use PurpleAccountManager added/removed signals
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
41716
diff
changeset
|
210 | g_signal_handlers_disconnect_by_func(manager, |
|
3bc9948e9f3c
Use PurpleAccountManager added/removed signals
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
41716
diff
changeset
|
211 | G_CALLBACK(account_removed_cb), NULL); |
|
13014
fa17f785b6fe
[gaim-migrate @ 15367]
Mark Doliner <markdoliner@pidgin.im>
parents:
13013
diff
changeset
|
212 | |
|
20341
a20de3c1c254
Rename Pidgin's hash table of ongoing autoreconnections to 'auto_reconns'
Will Thompson <resiak@pidgin.im>
parents:
20147
diff
changeset
|
213 | g_hash_table_destroy(auto_reconns); |
|
13014
fa17f785b6fe
[gaim-migrate @ 15367]
Mark Doliner <markdoliner@pidgin.im>
parents:
13013
diff
changeset
|
214 | } |