Fri, 14 Jan 2022 00:11:38 -0600
Remove purple_utf8_strftime
Testing Done:
Ran both finch and pidgin and verified that the timestamps in their debug windows remained the same format.
Reviewed at https://reviews.imfreedom.org/r/1227/
|
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" |
| 10643 | 27 | #include "gtkstatusbox.h" |
|
40496
6941fece679b
phase2 of pidgin.h: move existing file to pidgincore.h
Gary Kramlich <grim@reaperworld.com>
parents:
40443
diff
changeset
|
28 | #include "pidgincore.h" |
|
12404
657afdf0f596
[gaim-migrate @ 14711]
Richard Laager <rlaager@pidgin.im>
parents:
12296
diff
changeset
|
29 | #include "gtkutils.h" |
| 5717 | 30 | |
|
40412
c0905847d779
Use g_timeout_add_seconds some more.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
40360
diff
changeset
|
31 | #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
|
32 | #define INITIAL_RECON_DELAY_MAX 60 |
| 14053 | 33 | |
|
40412
c0905847d779
Use g_timeout_add_seconds some more.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
40360
diff
changeset
|
34 | #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
|
35 | #define MAX_RACCOON_DELAY "shorter in urban areas" |
| 11523 | 36 | |
| 37 | typedef struct { | |
| 38 | int delay; | |
| 39 | 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
|
40 | } PidginAutoRecon; |
| 11523 | 41 | |
|
35455
216a37403c5b
Fix a bunch of gtk-doc warnings in pidgin
Ankit Vani <a@nevitus.org>
parents:
35454
diff
changeset
|
42 | /* |
|
13014
fa17f785b6fe
[gaim-migrate @ 15367]
Mark Doliner <markdoliner@pidgin.im>
parents:
13013
diff
changeset
|
43 | * Contains accounts that are auto-reconnecting. |
| 15884 | 44 | * 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
|
45 | * value is a pointer to a PidginAutoRecon. |
|
13013
fde187d968dc
[gaim-migrate @ 15366]
Mark Doliner <markdoliner@pidgin.im>
parents:
12607
diff
changeset
|
46 | */ |
|
20341
a20de3c1c254
Rename Pidgin's hash table of ongoing autoreconnections to 'auto_reconns'
Will Thompson <resiak@pidgin.im>
parents:
20147
diff
changeset
|
47 | static GHashTable *auto_reconns = NULL; |
| 11523 | 48 | |
|
13014
fa17f785b6fe
[gaim-migrate @ 15367]
Mark Doliner <markdoliner@pidgin.im>
parents:
13013
diff
changeset
|
49 | static void |
| 15884 | 50 | pidgin_connection_connected(PurpleConnection *gc) |
| 5717 | 51 | { |
| 15884 | 52 | PurpleAccount *account; |
|
13014
fa17f785b6fe
[gaim-migrate @ 15367]
Mark Doliner <markdoliner@pidgin.im>
parents:
13013
diff
changeset
|
53 | |
| 15884 | 54 | account = purple_connection_get_account(gc); |
|
12607
4622f0adedf4
[gaim-migrate @ 14943]
Mark Doliner <markdoliner@pidgin.im>
parents:
12583
diff
changeset
|
55 | |
|
20341
a20de3c1c254
Rename Pidgin's hash table of ongoing autoreconnections to 'auto_reconns'
Will Thompson <resiak@pidgin.im>
parents:
20147
diff
changeset
|
56 | g_hash_table_remove(auto_reconns, account); |
| 5717 | 57 | } |
| 58 | ||
|
13014
fa17f785b6fe
[gaim-migrate @ 15367]
Mark Doliner <markdoliner@pidgin.im>
parents:
13013
diff
changeset
|
59 | static void |
| 15884 | 60 | pidgin_connection_disconnected(PurpleConnection *gc) |
| 5717 | 61 | { |
| 15884 | 62 | if (purple_connections_get_all() != NULL) |
|
5883
290fe1d16e60
[gaim-migrate @ 6315]
Christian Hammond <chipx86@chipx86.com>
parents:
5872
diff
changeset
|
63 | return; |
|
290fe1d16e60
[gaim-migrate @ 6315]
Christian Hammond <chipx86@chipx86.com>
parents:
5872
diff
changeset
|
64 | |
|
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
|
65 | pidgin_dialogs_destroy_all(); |
| 5717 | 66 | } |
| 67 | ||
|
13014
fa17f785b6fe
[gaim-migrate @ 15367]
Mark Doliner <markdoliner@pidgin.im>
parents:
13013
diff
changeset
|
68 | static void |
| 11523 | 69 | free_auto_recon(gpointer data) |
| 7493 | 70 | { |
|
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
|
71 | PidginAutoRecon *info = data; |
|
7912
b8f84918e7c1
[gaim-migrate @ 8573]
Mark Doliner <markdoliner@pidgin.im>
parents:
7890
diff
changeset
|
72 | |
| 11523 | 73 | if (info->timeout != 0) |
| 74 | g_source_remove(info->timeout); | |
|
7912
b8f84918e7c1
[gaim-migrate @ 8573]
Mark Doliner <markdoliner@pidgin.im>
parents:
7890
diff
changeset
|
75 | |
| 11523 | 76 | g_free(info); |
| 7493 | 77 | } |
| 78 | ||
| 11523 | 79 | static gboolean |
| 80 | do_signon(gpointer data) | |
|
7912
b8f84918e7c1
[gaim-migrate @ 8573]
Mark Doliner <markdoliner@pidgin.im>
parents:
7890
diff
changeset
|
81 | { |
| 15884 | 82 | 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
|
83 | PidginAutoRecon *info; |
| 15884 | 84 | PurpleStatus *status; |
|
10916
3de20dd2dade
[gaim-migrate @ 12675]
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
10915
diff
changeset
|
85 | |
| 15884 | 86 | purple_debug_info("autorecon", "do_signon called\n"); |
| 11523 | 87 | 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
|
88 | info = g_hash_table_lookup(auto_reconns, account); |
|
7912
b8f84918e7c1
[gaim-migrate @ 8573]
Mark Doliner <markdoliner@pidgin.im>
parents:
7890
diff
changeset
|
89 | |
| 11523 | 90 | if (info) |
| 91 | info->timeout = 0; | |
|
7912
b8f84918e7c1
[gaim-migrate @ 8573]
Mark Doliner <markdoliner@pidgin.im>
parents:
7890
diff
changeset
|
92 | |
| 15884 | 93 | status = purple_account_get_active_status(account); |
| 94 | if (purple_status_is_online(status)) | |
|
13375
5ce3cb98de9f
[gaim-migrate @ 15747]
Mark Doliner <markdoliner@pidgin.im>
parents:
13129
diff
changeset
|
95 | { |
| 15884 | 96 | purple_debug_info("autorecon", "calling purple_account_connect\n"); |
| 97 | purple_account_connect(account); | |
| 98 | purple_debug_info("autorecon", "done calling purple_account_connect\n"); | |
|
13375
5ce3cb98de9f
[gaim-migrate @ 15747]
Mark Doliner <markdoliner@pidgin.im>
parents:
13129
diff
changeset
|
99 | } |
|
7912
b8f84918e7c1
[gaim-migrate @ 8573]
Mark Doliner <markdoliner@pidgin.im>
parents:
7890
diff
changeset
|
100 | |
| 11523 | 101 | return FALSE; |
|
7912
b8f84918e7c1
[gaim-migrate @ 8573]
Mark Doliner <markdoliner@pidgin.im>
parents:
7890
diff
changeset
|
102 | } |
|
b8f84918e7c1
[gaim-migrate @ 8573]
Mark Doliner <markdoliner@pidgin.im>
parents:
7890
diff
changeset
|
103 | |
|
13014
fa17f785b6fe
[gaim-migrate @ 15367]
Mark Doliner <markdoliner@pidgin.im>
parents:
13013
diff
changeset
|
104 | static void |
|
32153
121f15699f88
Rename the report_disconnect_reason cb function to report_disconnect
Mark Doliner <markdoliner@pidgin.im>
parents:
32152
diff
changeset
|
105 | 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
|
106 | PurpleConnectionError reason, |
|
121f15699f88
Rename the report_disconnect_reason cb function to report_disconnect
Mark Doliner <markdoliner@pidgin.im>
parents:
32152
diff
changeset
|
107 | const char *text) |
| 7399 | 108 | { |
| 15884 | 109 | 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
|
110 | PidginAutoRecon *info; |
| 7808 | 111 | |
| 15884 | 112 | 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
|
113 | info = g_hash_table_lookup(auto_reconns, account); |
|
7912
b8f84918e7c1
[gaim-migrate @ 8573]
Mark Doliner <markdoliner@pidgin.im>
parents:
7890
diff
changeset
|
114 | |
| 21279 | 115 | if (!purple_connection_error_is_fatal (reason)) { |
|
12009
06852325c88f
[gaim-migrate @ 14302]
Mark Doliner <markdoliner@pidgin.im>
parents:
11721
diff
changeset
|
116 | 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
|
117 | 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
|
118 | g_hash_table_insert(auto_reconns, account, info); |
| 14053 | 119 | 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
|
120 | } else { |
| 11523 | 121 | info->delay = MIN(2 * info->delay, MAX_RECON_DELAY); |
| 122 | if (info->timeout != 0) | |
| 123 | g_source_remove(info->timeout); | |
|
7483
08237091e8a5
[gaim-migrate @ 8096]
Mark Doliner <markdoliner@pidgin.im>
parents:
7431
diff
changeset
|
124 | } |
|
40412
c0905847d779
Use g_timeout_add_seconds some more.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
40360
diff
changeset
|
125 | info->timeout = g_timeout_add_seconds(info->delay, do_signon, account); |
| 11559 | 126 | } else { |
|
13014
fa17f785b6fe
[gaim-migrate @ 15367]
Mark Doliner <markdoliner@pidgin.im>
parents:
13013
diff
changeset
|
127 | 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
|
128 | g_hash_table_remove(auto_reconns, account); |
|
11721
c74083492667
[gaim-migrate @ 14012]
Mark Doliner <markdoliner@pidgin.im>
parents:
11638
diff
changeset
|
129 | |
| 15884 | 130 | purple_account_set_enabled(account, PIDGIN_UI, FALSE); |
| 7399 | 131 | } |
| 132 | } | |
| 133 | ||
|
41209
909561f42b1f
port Pidgin to the new PurpleAccountManager api
Gary Kramlich <grim@reaperworld.com>
parents:
41087
diff
changeset
|
134 | static void |
|
909561f42b1f
port Pidgin to the new PurpleAccountManager api
Gary Kramlich <grim@reaperworld.com>
parents:
41087
diff
changeset
|
135 | pidgin_connection_network_connected(void) { |
|
909561f42b1f
port Pidgin to the new PurpleAccountManager api
Gary Kramlich <grim@reaperworld.com>
parents:
41087
diff
changeset
|
136 | PurpleAccountManager *manager = NULL; |
|
909561f42b1f
port Pidgin to the new PurpleAccountManager api
Gary Kramlich <grim@reaperworld.com>
parents:
41087
diff
changeset
|
137 | GList *l = NULL; |
| 14767 | 138 | |
|
41209
909561f42b1f
port Pidgin to the new PurpleAccountManager api
Gary Kramlich <grim@reaperworld.com>
parents:
41087
diff
changeset
|
139 | manager = purple_account_manager_get_default(); |
|
909561f42b1f
port Pidgin to the new PurpleAccountManager api
Gary Kramlich <grim@reaperworld.com>
parents:
41087
diff
changeset
|
140 | l = purple_account_manager_get_active(manager); |
|
909561f42b1f
port Pidgin to the new PurpleAccountManager api
Gary Kramlich <grim@reaperworld.com>
parents:
41087
diff
changeset
|
141 | |
|
909561f42b1f
port Pidgin to the new PurpleAccountManager api
Gary Kramlich <grim@reaperworld.com>
parents:
41087
diff
changeset
|
142 | 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
|
143 | 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
|
144 | g_hash_table_remove(auto_reconns, account); |
| 15884 | 145 | if (purple_account_is_disconnected(account)) |
|
14784
3a82321f46f2
[gaim-migrate @ 17476]
Daniel Atallah <datallah@pidgin.im>
parents:
14767
diff
changeset
|
146 | do_signon(account); |
|
41209
909561f42b1f
port Pidgin to the new PurpleAccountManager api
Gary Kramlich <grim@reaperworld.com>
parents:
41087
diff
changeset
|
147 | |
|
909561f42b1f
port Pidgin to the new PurpleAccountManager api
Gary Kramlich <grim@reaperworld.com>
parents:
41087
diff
changeset
|
148 | l = g_list_delete_link(l, l); |
| 14767 | 149 | } |
| 14758 | 150 | } |
| 151 | ||
|
41209
909561f42b1f
port Pidgin to the new PurpleAccountManager api
Gary Kramlich <grim@reaperworld.com>
parents:
41087
diff
changeset
|
152 | static void |
|
909561f42b1f
port Pidgin to the new PurpleAccountManager api
Gary Kramlich <grim@reaperworld.com>
parents:
41087
diff
changeset
|
153 | pidgin_connection_network_disconnected(void) { |
|
909561f42b1f
port Pidgin to the new PurpleAccountManager api
Gary Kramlich <grim@reaperworld.com>
parents:
41087
diff
changeset
|
154 | PurpleAccountManager *manager = NULL; |
|
909561f42b1f
port Pidgin to the new PurpleAccountManager api
Gary Kramlich <grim@reaperworld.com>
parents:
41087
diff
changeset
|
155 | GList *l = NULL; |
| 14767 | 156 | |
|
41209
909561f42b1f
port Pidgin to the new PurpleAccountManager api
Gary Kramlich <grim@reaperworld.com>
parents:
41087
diff
changeset
|
157 | manager = purple_account_manager_get_default(); |
|
909561f42b1f
port Pidgin to the new PurpleAccountManager api
Gary Kramlich <grim@reaperworld.com>
parents:
41087
diff
changeset
|
158 | l = purple_account_manager_get_active(manager); |
|
909561f42b1f
port Pidgin to the new PurpleAccountManager api
Gary Kramlich <grim@reaperworld.com>
parents:
41087
diff
changeset
|
159 | |
|
909561f42b1f
port Pidgin to the new PurpleAccountManager api
Gary Kramlich <grim@reaperworld.com>
parents:
41087
diff
changeset
|
160 | while(l != NULL) { |
| 15884 | 161 | PurpleAccount *a = (PurpleAccount*)l->data; |
| 162 | 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
|
163 | purple_account_disconnect(a); |
| 15090 | 164 | } |
|
41209
909561f42b1f
port Pidgin to the new PurpleAccountManager api
Gary Kramlich <grim@reaperworld.com>
parents:
41087
diff
changeset
|
165 | |
|
909561f42b1f
port Pidgin to the new PurpleAccountManager api
Gary Kramlich <grim@reaperworld.com>
parents:
41087
diff
changeset
|
166 | l = g_list_delete_link(l, l); |
| 14758 | 167 | } |
| 168 | } | |
| 169 | ||
| 15884 | 170 | static void pidgin_connection_notice(PurpleConnection *gc, const char *text) |
| 14758 | 171 | { } |
| 172 | ||
| 15884 | 173 | static PurpleConnectionUiOps conn_ui_ops = |
| 5717 | 174 | { |
|
41228
cfabfc1afd50
Make PidginStatusBox manage its own connecting state.
Gary Kramlich <grim@reaperworld.com>
parents:
41209
diff
changeset
|
175 | NULL, |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15442
diff
changeset
|
176 | pidgin_connection_connected, |
|
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15442
diff
changeset
|
177 | pidgin_connection_disconnected, |
|
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15442
diff
changeset
|
178 | pidgin_connection_notice, |
|
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15442
diff
changeset
|
179 | 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
|
180 | 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
|
181 | 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
|
182 | NULL, |
|
e6bcb1628c57
Patch from John 'rekkanoryo' Bailey to add the padding struct members in pidgin
Gary Kramlich <grim@reaperworld.com>
parents:
16263
diff
changeset
|
183 | NULL, |
|
34906
6f5e8a7bfe8c
Initialized new padding member in connection UI ops
Ankit Vani <a@nevitus.org>
parents:
34708
diff
changeset
|
184 | 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
|
185 | NULL |
| 5717 | 186 | }; |
| 187 | ||
| 15884 | 188 | PurpleConnectionUiOps * |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15442
diff
changeset
|
189 | pidgin_connections_get_ui_ops(void) |
| 5717 | 190 | { |
| 191 | return &conn_ui_ops; | |
| 192 | } | |
|
13014
fa17f785b6fe
[gaim-migrate @ 15367]
Mark Doliner <markdoliner@pidgin.im>
parents:
13013
diff
changeset
|
193 | |
|
fa17f785b6fe
[gaim-migrate @ 15367]
Mark Doliner <markdoliner@pidgin.im>
parents:
13013
diff
changeset
|
194 | static void |
| 15884 | 195 | account_removed_cb(PurpleAccount *account, gpointer user_data) |
|
13014
fa17f785b6fe
[gaim-migrate @ 15367]
Mark Doliner <markdoliner@pidgin.im>
parents:
13013
diff
changeset
|
196 | { |
|
20341
a20de3c1c254
Rename Pidgin's hash table of ongoing autoreconnections to 'auto_reconns'
Will Thompson <resiak@pidgin.im>
parents:
20147
diff
changeset
|
197 | g_hash_table_remove(auto_reconns, account); |
|
13014
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 | |
|
fa17f785b6fe
[gaim-migrate @ 15367]
Mark Doliner <markdoliner@pidgin.im>
parents:
13013
diff
changeset
|
201 | /************************************************************************** |
|
41087
4fc5b0ddf55e
Remove the + from GTK
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
41012
diff
changeset
|
202 | * GTK connection glue |
|
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_get_handle(void) |
|
13014
fa17f785b6fe
[gaim-migrate @ 15367]
Mark Doliner <markdoliner@pidgin.im>
parents:
13013
diff
changeset
|
207 | { |
|
fa17f785b6fe
[gaim-migrate @ 15367]
Mark Doliner <markdoliner@pidgin.im>
parents:
13013
diff
changeset
|
208 | static int handle; |
|
fa17f785b6fe
[gaim-migrate @ 15367]
Mark Doliner <markdoliner@pidgin.im>
parents:
13013
diff
changeset
|
209 | |
|
fa17f785b6fe
[gaim-migrate @ 15367]
Mark Doliner <markdoliner@pidgin.im>
parents:
13013
diff
changeset
|
210 | return &handle; |
|
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 | |
|
fa17f785b6fe
[gaim-migrate @ 15367]
Mark Doliner <markdoliner@pidgin.im>
parents:
13013
diff
changeset
|
213 | void |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15442
diff
changeset
|
214 | pidgin_connection_init(void) |
|
13014
fa17f785b6fe
[gaim-migrate @ 15367]
Mark Doliner <markdoliner@pidgin.im>
parents:
13013
diff
changeset
|
215 | { |
|
20341
a20de3c1c254
Rename Pidgin's hash table of ongoing autoreconnections to 'auto_reconns'
Will Thompson <resiak@pidgin.im>
parents:
20147
diff
changeset
|
216 | auto_reconns = g_hash_table_new_full( |
|
13014
fa17f785b6fe
[gaim-migrate @ 15367]
Mark Doliner <markdoliner@pidgin.im>
parents:
13013
diff
changeset
|
217 | g_direct_hash, g_direct_equal, |
|
fa17f785b6fe
[gaim-migrate @ 15367]
Mark Doliner <markdoliner@pidgin.im>
parents:
13013
diff
changeset
|
218 | NULL, free_auto_recon); |
|
fa17f785b6fe
[gaim-migrate @ 15367]
Mark Doliner <markdoliner@pidgin.im>
parents:
13013
diff
changeset
|
219 | |
| 15884 | 220 | 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
|
221 | pidgin_connection_get_handle(), |
| 15884 | 222 | PURPLE_CALLBACK(account_removed_cb), NULL); |
|
13014
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 | |
|
fa17f785b6fe
[gaim-migrate @ 15367]
Mark Doliner <markdoliner@pidgin.im>
parents:
13013
diff
changeset
|
225 | void |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15442
diff
changeset
|
226 | pidgin_connection_uninit(void) |
|
13014
fa17f785b6fe
[gaim-migrate @ 15367]
Mark Doliner <markdoliner@pidgin.im>
parents:
13013
diff
changeset
|
227 | { |
| 15884 | 228 | purple_signals_disconnect_by_handle(pidgin_connection_get_handle()); |
|
13014
fa17f785b6fe
[gaim-migrate @ 15367]
Mark Doliner <markdoliner@pidgin.im>
parents:
13013
diff
changeset
|
229 | |
|
20341
a20de3c1c254
Rename Pidgin's hash table of ongoing autoreconnections to 'auto_reconns'
Will Thompson <resiak@pidgin.im>
parents:
20147
diff
changeset
|
230 | g_hash_table_destroy(auto_reconns); |
|
13014
fa17f785b6fe
[gaim-migrate @ 15367]
Mark Doliner <markdoliner@pidgin.im>
parents:
13013
diff
changeset
|
231 | } |