Tue, 01 Dec 2020 01:00:55 -0600
Remove deleted zephyr files from translation.
Testing Done:
Run `ninja pidgin-pot`.
Reviewed at https://reviews.imfreedom.org/r/258/
|
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" |
|
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
|
29 | #include "pidginstock.h" |
|
12404
657afdf0f596
[gaim-migrate @ 14711]
Richard Laager <rlaager@pidgin.im>
parents:
12296
diff
changeset
|
30 | #include "gtkutils.h" |
| 5717 | 31 | |
|
40412
c0905847d779
Use g_timeout_add_seconds some more.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
40360
diff
changeset
|
32 | #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
|
33 | #define INITIAL_RECON_DELAY_MAX 60 |
| 14053 | 34 | |
|
40412
c0905847d779
Use g_timeout_add_seconds some more.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
40360
diff
changeset
|
35 | #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
|
36 | #define MAX_RACCOON_DELAY "shorter in urban areas" |
| 11523 | 37 | |
| 38 | typedef struct { | |
| 39 | int delay; | |
| 40 | 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
|
41 | } PidginAutoRecon; |
| 11523 | 42 | |
|
35455
216a37403c5b
Fix a bunch of gtk-doc warnings in pidgin
Ankit Vani <a@nevitus.org>
parents:
35454
diff
changeset
|
43 | /* |
|
13014
fa17f785b6fe
[gaim-migrate @ 15367]
Mark Doliner <markdoliner@pidgin.im>
parents:
13013
diff
changeset
|
44 | * Contains accounts that are auto-reconnecting. |
| 15884 | 45 | * 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
|
46 | * value is a pointer to a PidginAutoRecon. |
|
13013
fde187d968dc
[gaim-migrate @ 15366]
Mark Doliner <markdoliner@pidgin.im>
parents:
12607
diff
changeset
|
47 | */ |
|
20341
a20de3c1c254
Rename Pidgin's hash table of ongoing autoreconnections to 'auto_reconns'
Will Thompson <resiak@pidgin.im>
parents:
20147
diff
changeset
|
48 | static GHashTable *auto_reconns = NULL; |
| 11523 | 49 | |
|
13014
fa17f785b6fe
[gaim-migrate @ 15367]
Mark Doliner <markdoliner@pidgin.im>
parents:
13013
diff
changeset
|
50 | static void |
| 15884 | 51 | pidgin_connection_connect_progress(PurpleConnection *gc, |
| 5717 | 52 | const char *text, size_t step, size_t step_count) |
| 53 | { | |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15442
diff
changeset
|
54 | PidginBuddyList *gtkblist = pidgin_blist_get_default_gtk_blist(); |
| 10643 | 55 | if (!gtkblist) |
| 56 | return; | |
| 15577 | 57 | pidgin_status_box_set_connecting(PIDGIN_STATUS_BOX(gtkblist->statusbox), |
| 15884 | 58 | (purple_connections_get_connecting() != NULL)); |
| 15577 | 59 | pidgin_status_box_pulse_connecting(PIDGIN_STATUS_BOX(gtkblist->statusbox)); |
| 5717 | 60 | } |
|
13756
c7679a3eefb6
[gaim-migrate @ 16165]
Mark Doliner <markdoliner@pidgin.im>
parents:
13732
diff
changeset
|
61 | |
|
13014
fa17f785b6fe
[gaim-migrate @ 15367]
Mark Doliner <markdoliner@pidgin.im>
parents:
13013
diff
changeset
|
62 | static void |
| 15884 | 63 | pidgin_connection_connected(PurpleConnection *gc) |
| 5717 | 64 | { |
| 15884 | 65 | PurpleAccount *account; |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15442
diff
changeset
|
66 | PidginBuddyList *gtkblist; |
|
13014
fa17f785b6fe
[gaim-migrate @ 15367]
Mark Doliner <markdoliner@pidgin.im>
parents:
13013
diff
changeset
|
67 | |
| 15884 | 68 | account = purple_connection_get_account(gc); |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15442
diff
changeset
|
69 | gtkblist = pidgin_blist_get_default_gtk_blist(); |
|
13014
fa17f785b6fe
[gaim-migrate @ 15367]
Mark Doliner <markdoliner@pidgin.im>
parents:
13013
diff
changeset
|
70 | |
|
fa17f785b6fe
[gaim-migrate @ 15367]
Mark Doliner <markdoliner@pidgin.im>
parents:
13013
diff
changeset
|
71 | if (gtkblist != NULL) |
| 15577 | 72 | pidgin_status_box_set_connecting(PIDGIN_STATUS_BOX(gtkblist->statusbox), |
| 15884 | 73 | (purple_connections_get_connecting() != NULL)); |
|
12607
4622f0adedf4
[gaim-migrate @ 14943]
Mark Doliner <markdoliner@pidgin.im>
parents:
12583
diff
changeset
|
74 | |
|
20341
a20de3c1c254
Rename Pidgin's hash table of ongoing autoreconnections to 'auto_reconns'
Will Thompson <resiak@pidgin.im>
parents:
20147
diff
changeset
|
75 | g_hash_table_remove(auto_reconns, account); |
| 5717 | 76 | } |
| 77 | ||
|
13014
fa17f785b6fe
[gaim-migrate @ 15367]
Mark Doliner <markdoliner@pidgin.im>
parents:
13013
diff
changeset
|
78 | static void |
| 15884 | 79 | pidgin_connection_disconnected(PurpleConnection *gc) |
| 5717 | 80 | { |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15442
diff
changeset
|
81 | PidginBuddyList *gtkblist = pidgin_blist_get_default_gtk_blist(); |
| 10643 | 82 | if (!gtkblist) |
| 83 | return; | |
| 15577 | 84 | pidgin_status_box_set_connecting(PIDGIN_STATUS_BOX(gtkblist->statusbox), |
| 15884 | 85 | (purple_connections_get_connecting() != NULL)); |
|
5883
290fe1d16e60
[gaim-migrate @ 6315]
Christian Hammond <chipx86@chipx86.com>
parents:
5872
diff
changeset
|
86 | |
| 15884 | 87 | if (purple_connections_get_all() != NULL) |
|
5883
290fe1d16e60
[gaim-migrate @ 6315]
Christian Hammond <chipx86@chipx86.com>
parents:
5872
diff
changeset
|
88 | return; |
|
290fe1d16e60
[gaim-migrate @ 6315]
Christian Hammond <chipx86@chipx86.com>
parents:
5872
diff
changeset
|
89 | |
|
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
|
90 | pidgin_dialogs_destroy_all(); |
| 5717 | 91 | } |
| 92 | ||
|
13014
fa17f785b6fe
[gaim-migrate @ 15367]
Mark Doliner <markdoliner@pidgin.im>
parents:
13013
diff
changeset
|
93 | static void |
| 11523 | 94 | free_auto_recon(gpointer data) |
| 7493 | 95 | { |
|
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
|
96 | PidginAutoRecon *info = data; |
|
7912
b8f84918e7c1
[gaim-migrate @ 8573]
Mark Doliner <markdoliner@pidgin.im>
parents:
7890
diff
changeset
|
97 | |
| 11523 | 98 | if (info->timeout != 0) |
| 99 | g_source_remove(info->timeout); | |
|
7912
b8f84918e7c1
[gaim-migrate @ 8573]
Mark Doliner <markdoliner@pidgin.im>
parents:
7890
diff
changeset
|
100 | |
| 11523 | 101 | g_free(info); |
| 7493 | 102 | } |
| 103 | ||
| 11523 | 104 | static gboolean |
| 105 | do_signon(gpointer data) | |
|
7912
b8f84918e7c1
[gaim-migrate @ 8573]
Mark Doliner <markdoliner@pidgin.im>
parents:
7890
diff
changeset
|
106 | { |
| 15884 | 107 | 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
|
108 | PidginAutoRecon *info; |
| 15884 | 109 | PurpleStatus *status; |
|
10916
3de20dd2dade
[gaim-migrate @ 12675]
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
10915
diff
changeset
|
110 | |
| 15884 | 111 | purple_debug_info("autorecon", "do_signon called\n"); |
| 11523 | 112 | 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
|
113 | info = g_hash_table_lookup(auto_reconns, account); |
|
7912
b8f84918e7c1
[gaim-migrate @ 8573]
Mark Doliner <markdoliner@pidgin.im>
parents:
7890
diff
changeset
|
114 | |
| 11523 | 115 | if (info) |
| 116 | info->timeout = 0; | |
|
7912
b8f84918e7c1
[gaim-migrate @ 8573]
Mark Doliner <markdoliner@pidgin.im>
parents:
7890
diff
changeset
|
117 | |
| 15884 | 118 | status = purple_account_get_active_status(account); |
| 119 | if (purple_status_is_online(status)) | |
|
13375
5ce3cb98de9f
[gaim-migrate @ 15747]
Mark Doliner <markdoliner@pidgin.im>
parents:
13129
diff
changeset
|
120 | { |
| 15884 | 121 | purple_debug_info("autorecon", "calling purple_account_connect\n"); |
| 122 | purple_account_connect(account); | |
| 123 | purple_debug_info("autorecon", "done calling purple_account_connect\n"); | |
|
13375
5ce3cb98de9f
[gaim-migrate @ 15747]
Mark Doliner <markdoliner@pidgin.im>
parents:
13129
diff
changeset
|
124 | } |
|
7912
b8f84918e7c1
[gaim-migrate @ 8573]
Mark Doliner <markdoliner@pidgin.im>
parents:
7890
diff
changeset
|
125 | |
| 11523 | 126 | return FALSE; |
|
7912
b8f84918e7c1
[gaim-migrate @ 8573]
Mark Doliner <markdoliner@pidgin.im>
parents:
7890
diff
changeset
|
127 | } |
|
b8f84918e7c1
[gaim-migrate @ 8573]
Mark Doliner <markdoliner@pidgin.im>
parents:
7890
diff
changeset
|
128 | |
|
13014
fa17f785b6fe
[gaim-migrate @ 15367]
Mark Doliner <markdoliner@pidgin.im>
parents:
13013
diff
changeset
|
129 | static void |
|
32153
121f15699f88
Rename the report_disconnect_reason cb function to report_disconnect
Mark Doliner <markdoliner@pidgin.im>
parents:
32152
diff
changeset
|
130 | 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
|
131 | PurpleConnectionError reason, |
|
121f15699f88
Rename the report_disconnect_reason cb function to report_disconnect
Mark Doliner <markdoliner@pidgin.im>
parents:
32152
diff
changeset
|
132 | const char *text) |
| 7399 | 133 | { |
| 15884 | 134 | 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
|
135 | PidginAutoRecon *info; |
| 7808 | 136 | |
| 15884 | 137 | 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
|
138 | info = g_hash_table_lookup(auto_reconns, account); |
|
7912
b8f84918e7c1
[gaim-migrate @ 8573]
Mark Doliner <markdoliner@pidgin.im>
parents:
7890
diff
changeset
|
139 | |
| 21279 | 140 | if (!purple_connection_error_is_fatal (reason)) { |
|
12009
06852325c88f
[gaim-migrate @ 14302]
Mark Doliner <markdoliner@pidgin.im>
parents:
11721
diff
changeset
|
141 | 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
|
142 | 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
|
143 | g_hash_table_insert(auto_reconns, account, info); |
| 14053 | 144 | 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
|
145 | } else { |
| 11523 | 146 | info->delay = MIN(2 * info->delay, MAX_RECON_DELAY); |
| 147 | if (info->timeout != 0) | |
| 148 | g_source_remove(info->timeout); | |
|
7483
08237091e8a5
[gaim-migrate @ 8096]
Mark Doliner <markdoliner@pidgin.im>
parents:
7431
diff
changeset
|
149 | } |
|
40412
c0905847d779
Use g_timeout_add_seconds some more.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
40360
diff
changeset
|
150 | info->timeout = g_timeout_add_seconds(info->delay, do_signon, account); |
| 11559 | 151 | } else { |
|
13014
fa17f785b6fe
[gaim-migrate @ 15367]
Mark Doliner <markdoliner@pidgin.im>
parents:
13013
diff
changeset
|
152 | 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
|
153 | g_hash_table_remove(auto_reconns, account); |
|
11721
c74083492667
[gaim-migrate @ 14012]
Mark Doliner <markdoliner@pidgin.im>
parents:
11638
diff
changeset
|
154 | |
| 15884 | 155 | purple_account_set_enabled(account, PIDGIN_UI, FALSE); |
| 7399 | 156 | } |
| 157 | } | |
| 158 | ||
|
22104
56970903b8e9
Probe for -Wstrict-prototypes to get some more warnings. I then cleaned up
Richard Laager <rlaager@pidgin.im>
parents:
22089
diff
changeset
|
159 | static void pidgin_connection_network_connected (void) |
| 14758 | 160 | { |
|
21942
8ee08ef6b2a3
Fix a GList being leaked when dealing with network connection/disconnection events.
Daniel Atallah <datallah@pidgin.im>
parents:
21512
diff
changeset
|
161 | GList *list, *l; |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15442
diff
changeset
|
162 | PidginBuddyList *gtkblist = pidgin_blist_get_default_gtk_blist(); |
| 14767 | 163 | |
| 164 | if(gtkblist) | |
| 15577 | 165 | pidgin_status_box_set_network_available(PIDGIN_STATUS_BOX(gtkblist->statusbox), TRUE); |
| 14767 | 166 | |
|
21942
8ee08ef6b2a3
Fix a GList being leaked when dealing with network connection/disconnection events.
Daniel Atallah <datallah@pidgin.im>
parents:
21512
diff
changeset
|
167 | l = list = purple_accounts_get_all_active(); |
|
8ee08ef6b2a3
Fix a GList being leaked when dealing with network connection/disconnection events.
Daniel Atallah <datallah@pidgin.im>
parents:
21512
diff
changeset
|
168 | while (l) { |
|
8ee08ef6b2a3
Fix a GList being leaked when dealing with network connection/disconnection events.
Daniel Atallah <datallah@pidgin.im>
parents:
21512
diff
changeset
|
169 | 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
|
170 | g_hash_table_remove(auto_reconns, account); |
| 15884 | 171 | if (purple_account_is_disconnected(account)) |
|
14784
3a82321f46f2
[gaim-migrate @ 17476]
Daniel Atallah <datallah@pidgin.im>
parents:
14767
diff
changeset
|
172 | do_signon(account); |
|
21942
8ee08ef6b2a3
Fix a GList being leaked when dealing with network connection/disconnection events.
Daniel Atallah <datallah@pidgin.im>
parents:
21512
diff
changeset
|
173 | l = l->next; |
| 14767 | 174 | } |
|
21942
8ee08ef6b2a3
Fix a GList being leaked when dealing with network connection/disconnection events.
Daniel Atallah <datallah@pidgin.im>
parents:
21512
diff
changeset
|
175 | g_list_free(list); |
| 14758 | 176 | } |
| 177 | ||
|
22104
56970903b8e9
Probe for -Wstrict-prototypes to get some more warnings. I then cleaned up
Richard Laager <rlaager@pidgin.im>
parents:
22089
diff
changeset
|
178 | static void pidgin_connection_network_disconnected (void) |
| 14758 | 179 | { |
|
21942
8ee08ef6b2a3
Fix a GList being leaked when dealing with network connection/disconnection events.
Daniel Atallah <datallah@pidgin.im>
parents:
21512
diff
changeset
|
180 | GList *list, *l; |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15442
diff
changeset
|
181 | PidginBuddyList *gtkblist = pidgin_blist_get_default_gtk_blist(); |
|
21942
8ee08ef6b2a3
Fix a GList being leaked when dealing with network connection/disconnection events.
Daniel Atallah <datallah@pidgin.im>
parents:
21512
diff
changeset
|
182 | |
| 14767 | 183 | if(gtkblist) |
| 15577 | 184 | pidgin_status_box_set_network_available(PIDGIN_STATUS_BOX(gtkblist->statusbox), FALSE); |
| 14767 | 185 | |
|
21942
8ee08ef6b2a3
Fix a GList being leaked when dealing with network connection/disconnection events.
Daniel Atallah <datallah@pidgin.im>
parents:
21512
diff
changeset
|
186 | l = list = purple_accounts_get_all_active(); |
| 14758 | 187 | while (l) { |
| 15884 | 188 | PurpleAccount *a = (PurpleAccount*)l->data; |
| 189 | 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
|
190 | purple_account_disconnect(a); |
| 15090 | 191 | } |
| 14758 | 192 | l = l->next; |
| 193 | } | |
|
21942
8ee08ef6b2a3
Fix a GList being leaked when dealing with network connection/disconnection events.
Daniel Atallah <datallah@pidgin.im>
parents:
21512
diff
changeset
|
194 | g_list_free(list); |
| 14758 | 195 | } |
| 196 | ||
| 15884 | 197 | static void pidgin_connection_notice(PurpleConnection *gc, const char *text) |
| 14758 | 198 | { } |
| 199 | ||
| 15884 | 200 | static PurpleConnectionUiOps conn_ui_ops = |
| 5717 | 201 | { |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15442
diff
changeset
|
202 | pidgin_connection_connect_progress, |
|
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15442
diff
changeset
|
203 | pidgin_connection_connected, |
|
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15442
diff
changeset
|
204 | pidgin_connection_disconnected, |
|
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15442
diff
changeset
|
205 | pidgin_connection_notice, |
|
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15442
diff
changeset
|
206 | 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
|
207 | 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
|
208 | 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
|
209 | NULL, |
|
e6bcb1628c57
Patch from John 'rekkanoryo' Bailey to add the padding struct members in pidgin
Gary Kramlich <grim@reaperworld.com>
parents:
16263
diff
changeset
|
210 | NULL, |
|
34906
6f5e8a7bfe8c
Initialized new padding member in connection UI ops
Ankit Vani <a@nevitus.org>
parents:
34708
diff
changeset
|
211 | 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
|
212 | NULL |
| 5717 | 213 | }; |
| 214 | ||
| 15884 | 215 | PurpleConnectionUiOps * |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15442
diff
changeset
|
216 | pidgin_connections_get_ui_ops(void) |
| 5717 | 217 | { |
| 218 | return &conn_ui_ops; | |
| 219 | } | |
|
13014
fa17f785b6fe
[gaim-migrate @ 15367]
Mark Doliner <markdoliner@pidgin.im>
parents:
13013
diff
changeset
|
220 | |
|
fa17f785b6fe
[gaim-migrate @ 15367]
Mark Doliner <markdoliner@pidgin.im>
parents:
13013
diff
changeset
|
221 | static void |
| 15884 | 222 | account_removed_cb(PurpleAccount *account, gpointer user_data) |
|
13014
fa17f785b6fe
[gaim-migrate @ 15367]
Mark Doliner <markdoliner@pidgin.im>
parents:
13013
diff
changeset
|
223 | { |
|
20341
a20de3c1c254
Rename Pidgin's hash table of ongoing autoreconnections to 'auto_reconns'
Will Thompson <resiak@pidgin.im>
parents:
20147
diff
changeset
|
224 | g_hash_table_remove(auto_reconns, account); |
|
13014
fa17f785b6fe
[gaim-migrate @ 15367]
Mark Doliner <markdoliner@pidgin.im>
parents:
13013
diff
changeset
|
225 | } |
|
fa17f785b6fe
[gaim-migrate @ 15367]
Mark Doliner <markdoliner@pidgin.im>
parents:
13013
diff
changeset
|
226 | |
|
fa17f785b6fe
[gaim-migrate @ 15367]
Mark Doliner <markdoliner@pidgin.im>
parents:
13013
diff
changeset
|
227 | |
|
fa17f785b6fe
[gaim-migrate @ 15367]
Mark Doliner <markdoliner@pidgin.im>
parents:
13013
diff
changeset
|
228 | /************************************************************************** |
|
fa17f785b6fe
[gaim-migrate @ 15367]
Mark Doliner <markdoliner@pidgin.im>
parents:
13013
diff
changeset
|
229 | * GTK+ connection glue |
|
fa17f785b6fe
[gaim-migrate @ 15367]
Mark Doliner <markdoliner@pidgin.im>
parents:
13013
diff
changeset
|
230 | **************************************************************************/ |
|
fa17f785b6fe
[gaim-migrate @ 15367]
Mark Doliner <markdoliner@pidgin.im>
parents:
13013
diff
changeset
|
231 | |
|
fa17f785b6fe
[gaim-migrate @ 15367]
Mark Doliner <markdoliner@pidgin.im>
parents:
13013
diff
changeset
|
232 | void * |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15442
diff
changeset
|
233 | pidgin_connection_get_handle(void) |
|
13014
fa17f785b6fe
[gaim-migrate @ 15367]
Mark Doliner <markdoliner@pidgin.im>
parents:
13013
diff
changeset
|
234 | { |
|
fa17f785b6fe
[gaim-migrate @ 15367]
Mark Doliner <markdoliner@pidgin.im>
parents:
13013
diff
changeset
|
235 | static int handle; |
|
fa17f785b6fe
[gaim-migrate @ 15367]
Mark Doliner <markdoliner@pidgin.im>
parents:
13013
diff
changeset
|
236 | |
|
fa17f785b6fe
[gaim-migrate @ 15367]
Mark Doliner <markdoliner@pidgin.im>
parents:
13013
diff
changeset
|
237 | return &handle; |
|
fa17f785b6fe
[gaim-migrate @ 15367]
Mark Doliner <markdoliner@pidgin.im>
parents:
13013
diff
changeset
|
238 | } |
|
fa17f785b6fe
[gaim-migrate @ 15367]
Mark Doliner <markdoliner@pidgin.im>
parents:
13013
diff
changeset
|
239 | |
|
fa17f785b6fe
[gaim-migrate @ 15367]
Mark Doliner <markdoliner@pidgin.im>
parents:
13013
diff
changeset
|
240 | void |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15442
diff
changeset
|
241 | pidgin_connection_init(void) |
|
13014
fa17f785b6fe
[gaim-migrate @ 15367]
Mark Doliner <markdoliner@pidgin.im>
parents:
13013
diff
changeset
|
242 | { |
|
20341
a20de3c1c254
Rename Pidgin's hash table of ongoing autoreconnections to 'auto_reconns'
Will Thompson <resiak@pidgin.im>
parents:
20147
diff
changeset
|
243 | auto_reconns = g_hash_table_new_full( |
|
13014
fa17f785b6fe
[gaim-migrate @ 15367]
Mark Doliner <markdoliner@pidgin.im>
parents:
13013
diff
changeset
|
244 | g_direct_hash, g_direct_equal, |
|
fa17f785b6fe
[gaim-migrate @ 15367]
Mark Doliner <markdoliner@pidgin.im>
parents:
13013
diff
changeset
|
245 | NULL, free_auto_recon); |
|
fa17f785b6fe
[gaim-migrate @ 15367]
Mark Doliner <markdoliner@pidgin.im>
parents:
13013
diff
changeset
|
246 | |
| 15884 | 247 | 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
|
248 | pidgin_connection_get_handle(), |
| 15884 | 249 | PURPLE_CALLBACK(account_removed_cb), NULL); |
|
13014
fa17f785b6fe
[gaim-migrate @ 15367]
Mark Doliner <markdoliner@pidgin.im>
parents:
13013
diff
changeset
|
250 | } |
|
fa17f785b6fe
[gaim-migrate @ 15367]
Mark Doliner <markdoliner@pidgin.im>
parents:
13013
diff
changeset
|
251 | |
|
fa17f785b6fe
[gaim-migrate @ 15367]
Mark Doliner <markdoliner@pidgin.im>
parents:
13013
diff
changeset
|
252 | void |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15442
diff
changeset
|
253 | pidgin_connection_uninit(void) |
|
13014
fa17f785b6fe
[gaim-migrate @ 15367]
Mark Doliner <markdoliner@pidgin.im>
parents:
13013
diff
changeset
|
254 | { |
| 15884 | 255 | purple_signals_disconnect_by_handle(pidgin_connection_get_handle()); |
|
13014
fa17f785b6fe
[gaim-migrate @ 15367]
Mark Doliner <markdoliner@pidgin.im>
parents:
13013
diff
changeset
|
256 | |
|
20341
a20de3c1c254
Rename Pidgin's hash table of ongoing autoreconnections to 'auto_reconns'
Will Thompson <resiak@pidgin.im>
parents:
20147
diff
changeset
|
257 | g_hash_table_destroy(auto_reconns); |
|
13014
fa17f785b6fe
[gaim-migrate @ 15367]
Mark Doliner <markdoliner@pidgin.im>
parents:
13013
diff
changeset
|
258 | } |