Thu, 25 Aug 2022 22:45:58 -0500
Handle delete event in more dialogs (probably all, but can't be too sure.)
Testing Done:
Compile only.
Reviewed at https://reviews.imfreedom.org/r/1652/
|
39887
9c8f874c74a0
Clean up all of the license headers
Gary Kramlich <grim@reaperworld.com>
parents:
35456
diff
changeset
|
1 | /* |
|
9c8f874c74a0
Clean up all of the license headers
Gary Kramlich <grim@reaperworld.com>
parents:
35456
diff
changeset
|
2 | * finch |
|
14620
90d599495d65
[gaim-migrate @ 17281]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14014
diff
changeset
|
3 | * |
|
15931
716b5fac1895
Re-sed the copyright notices so they don't all talk about Purple.
Richard Laager <rlaager@pidgin.im>
parents:
15906
diff
changeset
|
4 | * Finch is the legal property of its developers, whose names are too numerous |
|
14620
90d599495d65
[gaim-migrate @ 17281]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14014
diff
changeset
|
5 | * to list here. Please refer to the COPYRIGHT file distributed with this |
|
90d599495d65
[gaim-migrate @ 17281]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14014
diff
changeset
|
6 | * source distribution. |
|
90d599495d65
[gaim-migrate @ 17281]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14014
diff
changeset
|
7 | * |
|
90d599495d65
[gaim-migrate @ 17281]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14014
diff
changeset
|
8 | * This program is free software; you can redistribute it and/or modify |
|
90d599495d65
[gaim-migrate @ 17281]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14014
diff
changeset
|
9 | * it under the terms of the GNU General Public License as published by |
|
90d599495d65
[gaim-migrate @ 17281]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14014
diff
changeset
|
10 | * the Free Software Foundation; either version 2 of the License, or |
|
90d599495d65
[gaim-migrate @ 17281]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14014
diff
changeset
|
11 | * (at your option) any later version. |
|
90d599495d65
[gaim-migrate @ 17281]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14014
diff
changeset
|
12 | * |
|
90d599495d65
[gaim-migrate @ 17281]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14014
diff
changeset
|
13 | * This program is distributed in the hope that it will be useful, |
|
90d599495d65
[gaim-migrate @ 17281]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14014
diff
changeset
|
14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
90d599495d65
[gaim-migrate @ 17281]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14014
diff
changeset
|
15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
90d599495d65
[gaim-migrate @ 17281]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14014
diff
changeset
|
16 | * GNU General Public License for more details. |
|
90d599495d65
[gaim-migrate @ 17281]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14014
diff
changeset
|
17 | * |
|
90d599495d65
[gaim-migrate @ 17281]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14014
diff
changeset
|
18 | * You should have received a copy of the GNU General Public License |
|
90d599495d65
[gaim-migrate @ 17281]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14014
diff
changeset
|
19 | * 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:
18273
diff
changeset
|
20 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA |
|
14620
90d599495d65
[gaim-migrate @ 17281]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14014
diff
changeset
|
21 | */ |
|
39887
9c8f874c74a0
Clean up all of the license headers
Gary Kramlich <grim@reaperworld.com>
parents:
35456
diff
changeset
|
22 | |
|
40441
f23c7e772667
Make sure we're not including the gettext macros in header files and deal with the repercussions of that.
Gary Kramlich <grim@reaperworld.com>
parents:
40439
diff
changeset
|
23 | #include <glib/gi18n-lib.h> |
|
f23c7e772667
Make sure we're not including the gettext macros in header files and deal with the repercussions of that.
Gary Kramlich <grim@reaperworld.com>
parents:
40439
diff
changeset
|
24 | |
|
40359
ca141ea93b83
Make all of finch use purple.h
Gary Kramlich <grim@reaperworld.com>
parents:
39887
diff
changeset
|
25 | #include <purple.h> |
|
14014
223d99ce2f06
[gaim-migrate @ 16500]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
26 | |
|
19969
53aca1037b2c
Instead of just notifying the user about a connection error, give him options
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
19859
diff
changeset
|
27 | #include "gntaccount.h" |
|
14014
223d99ce2f06
[gaim-migrate @ 16500]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
28 | #include "gntconn.h" |
|
40616
064ff9f4150a
Don't allow libraries to include their own global header files.
Gary Kramlich <grim@reaperworld.com>
parents:
40443
diff
changeset
|
29 | #include "libfinch.h" |
|
14014
223d99ce2f06
[gaim-migrate @ 16500]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
30 | |
|
40412
c0905847d779
Use g_timeout_add_seconds some more.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
40359
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:
40359
diff
changeset
|
32 | #define INITIAL_RECON_DELAY_MAX 60 |
|
17401
4db9d9d3e928
Finch autoreconnecting (largely copy/paste from pidgin)
Richard Nelson <wabz@pidgin.im>
parents:
17164
diff
changeset
|
33 | |
|
40412
c0905847d779
Use g_timeout_add_seconds some more.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
40359
diff
changeset
|
34 | #define MAX_RECON_DELAY 600 |
|
17401
4db9d9d3e928
Finch autoreconnecting (largely copy/paste from pidgin)
Richard Nelson <wabz@pidgin.im>
parents:
17164
diff
changeset
|
35 | |
|
4db9d9d3e928
Finch autoreconnecting (largely copy/paste from pidgin)
Richard Nelson <wabz@pidgin.im>
parents:
17164
diff
changeset
|
36 | typedef struct { |
|
4db9d9d3e928
Finch autoreconnecting (largely copy/paste from pidgin)
Richard Nelson <wabz@pidgin.im>
parents:
17164
diff
changeset
|
37 | int delay; |
|
4db9d9d3e928
Finch autoreconnecting (largely copy/paste from pidgin)
Richard Nelson <wabz@pidgin.im>
parents:
17164
diff
changeset
|
38 | guint timeout; |
|
4db9d9d3e928
Finch autoreconnecting (largely copy/paste from pidgin)
Richard Nelson <wabz@pidgin.im>
parents:
17164
diff
changeset
|
39 | } FinchAutoRecon; |
|
4db9d9d3e928
Finch autoreconnecting (largely copy/paste from pidgin)
Richard Nelson <wabz@pidgin.im>
parents:
17164
diff
changeset
|
40 | |
|
35456
821aa4bcb6fa
Fix a bunch of gtk-doc warnings in finch
Ankit Vani <a@nevitus.org>
parents:
35454
diff
changeset
|
41 | /* |
|
17401
4db9d9d3e928
Finch autoreconnecting (largely copy/paste from pidgin)
Richard Nelson <wabz@pidgin.im>
parents:
17164
diff
changeset
|
42 | * Contains accounts that are auto-reconnecting. |
|
4db9d9d3e928
Finch autoreconnecting (largely copy/paste from pidgin)
Richard Nelson <wabz@pidgin.im>
parents:
17164
diff
changeset
|
43 | * The key is a pointer to the PurpleAccount and the |
|
4db9d9d3e928
Finch autoreconnecting (largely copy/paste from pidgin)
Richard Nelson <wabz@pidgin.im>
parents:
17164
diff
changeset
|
44 | * value is a pointer to a FinchAutoRecon. |
|
4db9d9d3e928
Finch autoreconnecting (largely copy/paste from pidgin)
Richard Nelson <wabz@pidgin.im>
parents:
17164
diff
changeset
|
45 | */ |
|
4db9d9d3e928
Finch autoreconnecting (largely copy/paste from pidgin)
Richard Nelson <wabz@pidgin.im>
parents:
17164
diff
changeset
|
46 | static GHashTable *hash = NULL; |
|
4db9d9d3e928
Finch autoreconnecting (largely copy/paste from pidgin)
Richard Nelson <wabz@pidgin.im>
parents:
17164
diff
changeset
|
47 | |
|
4db9d9d3e928
Finch autoreconnecting (largely copy/paste from pidgin)
Richard Nelson <wabz@pidgin.im>
parents:
17164
diff
changeset
|
48 | static void |
|
4db9d9d3e928
Finch autoreconnecting (largely copy/paste from pidgin)
Richard Nelson <wabz@pidgin.im>
parents:
17164
diff
changeset
|
49 | free_auto_recon(gpointer data) |
|
4db9d9d3e928
Finch autoreconnecting (largely copy/paste from pidgin)
Richard Nelson <wabz@pidgin.im>
parents:
17164
diff
changeset
|
50 | { |
|
4db9d9d3e928
Finch autoreconnecting (largely copy/paste from pidgin)
Richard Nelson <wabz@pidgin.im>
parents:
17164
diff
changeset
|
51 | FinchAutoRecon *info = data; |
|
4db9d9d3e928
Finch autoreconnecting (largely copy/paste from pidgin)
Richard Nelson <wabz@pidgin.im>
parents:
17164
diff
changeset
|
52 | |
|
4db9d9d3e928
Finch autoreconnecting (largely copy/paste from pidgin)
Richard Nelson <wabz@pidgin.im>
parents:
17164
diff
changeset
|
53 | if (info->timeout != 0) |
|
4db9d9d3e928
Finch autoreconnecting (largely copy/paste from pidgin)
Richard Nelson <wabz@pidgin.im>
parents:
17164
diff
changeset
|
54 | g_source_remove(info->timeout); |
|
4db9d9d3e928
Finch autoreconnecting (largely copy/paste from pidgin)
Richard Nelson <wabz@pidgin.im>
parents:
17164
diff
changeset
|
55 | |
|
4db9d9d3e928
Finch autoreconnecting (largely copy/paste from pidgin)
Richard Nelson <wabz@pidgin.im>
parents:
17164
diff
changeset
|
56 | g_free(info); |
|
4db9d9d3e928
Finch autoreconnecting (largely copy/paste from pidgin)
Richard Nelson <wabz@pidgin.im>
parents:
17164
diff
changeset
|
57 | } |
|
4db9d9d3e928
Finch autoreconnecting (largely copy/paste from pidgin)
Richard Nelson <wabz@pidgin.im>
parents:
17164
diff
changeset
|
58 | |
|
4db9d9d3e928
Finch autoreconnecting (largely copy/paste from pidgin)
Richard Nelson <wabz@pidgin.im>
parents:
17164
diff
changeset
|
59 | |
|
4db9d9d3e928
Finch autoreconnecting (largely copy/paste from pidgin)
Richard Nelson <wabz@pidgin.im>
parents:
17164
diff
changeset
|
60 | static gboolean |
|
4db9d9d3e928
Finch autoreconnecting (largely copy/paste from pidgin)
Richard Nelson <wabz@pidgin.im>
parents:
17164
diff
changeset
|
61 | do_signon(gpointer data) |
|
4db9d9d3e928
Finch autoreconnecting (largely copy/paste from pidgin)
Richard Nelson <wabz@pidgin.im>
parents:
17164
diff
changeset
|
62 | { |
|
4db9d9d3e928
Finch autoreconnecting (largely copy/paste from pidgin)
Richard Nelson <wabz@pidgin.im>
parents:
17164
diff
changeset
|
63 | PurpleAccount *account = data; |
|
4db9d9d3e928
Finch autoreconnecting (largely copy/paste from pidgin)
Richard Nelson <wabz@pidgin.im>
parents:
17164
diff
changeset
|
64 | FinchAutoRecon *info; |
|
4db9d9d3e928
Finch autoreconnecting (largely copy/paste from pidgin)
Richard Nelson <wabz@pidgin.im>
parents:
17164
diff
changeset
|
65 | PurpleStatus *status; |
|
4db9d9d3e928
Finch autoreconnecting (largely copy/paste from pidgin)
Richard Nelson <wabz@pidgin.im>
parents:
17164
diff
changeset
|
66 | |
|
4db9d9d3e928
Finch autoreconnecting (largely copy/paste from pidgin)
Richard Nelson <wabz@pidgin.im>
parents:
17164
diff
changeset
|
67 | purple_debug_info("autorecon", "do_signon called\n"); |
|
4db9d9d3e928
Finch autoreconnecting (largely copy/paste from pidgin)
Richard Nelson <wabz@pidgin.im>
parents:
17164
diff
changeset
|
68 | g_return_val_if_fail(account != NULL, FALSE); |
|
4db9d9d3e928
Finch autoreconnecting (largely copy/paste from pidgin)
Richard Nelson <wabz@pidgin.im>
parents:
17164
diff
changeset
|
69 | info = g_hash_table_lookup(hash, account); |
|
4db9d9d3e928
Finch autoreconnecting (largely copy/paste from pidgin)
Richard Nelson <wabz@pidgin.im>
parents:
17164
diff
changeset
|
70 | |
|
4db9d9d3e928
Finch autoreconnecting (largely copy/paste from pidgin)
Richard Nelson <wabz@pidgin.im>
parents:
17164
diff
changeset
|
71 | if (info) |
|
4db9d9d3e928
Finch autoreconnecting (largely copy/paste from pidgin)
Richard Nelson <wabz@pidgin.im>
parents:
17164
diff
changeset
|
72 | info->timeout = 0; |
|
4db9d9d3e928
Finch autoreconnecting (largely copy/paste from pidgin)
Richard Nelson <wabz@pidgin.im>
parents:
17164
diff
changeset
|
73 | |
|
4db9d9d3e928
Finch autoreconnecting (largely copy/paste from pidgin)
Richard Nelson <wabz@pidgin.im>
parents:
17164
diff
changeset
|
74 | status = purple_account_get_active_status(account); |
|
4db9d9d3e928
Finch autoreconnecting (largely copy/paste from pidgin)
Richard Nelson <wabz@pidgin.im>
parents:
17164
diff
changeset
|
75 | if (purple_status_is_online(status)) |
|
4db9d9d3e928
Finch autoreconnecting (largely copy/paste from pidgin)
Richard Nelson <wabz@pidgin.im>
parents:
17164
diff
changeset
|
76 | { |
|
4db9d9d3e928
Finch autoreconnecting (largely copy/paste from pidgin)
Richard Nelson <wabz@pidgin.im>
parents:
17164
diff
changeset
|
77 | purple_debug_info("autorecon", "calling purple_account_connect\n"); |
|
4db9d9d3e928
Finch autoreconnecting (largely copy/paste from pidgin)
Richard Nelson <wabz@pidgin.im>
parents:
17164
diff
changeset
|
78 | purple_account_connect(account); |
|
4db9d9d3e928
Finch autoreconnecting (largely copy/paste from pidgin)
Richard Nelson <wabz@pidgin.im>
parents:
17164
diff
changeset
|
79 | purple_debug_info("autorecon", "done calling purple_account_connect\n"); |
|
4db9d9d3e928
Finch autoreconnecting (largely copy/paste from pidgin)
Richard Nelson <wabz@pidgin.im>
parents:
17164
diff
changeset
|
80 | } |
|
4db9d9d3e928
Finch autoreconnecting (largely copy/paste from pidgin)
Richard Nelson <wabz@pidgin.im>
parents:
17164
diff
changeset
|
81 | |
|
4db9d9d3e928
Finch autoreconnecting (largely copy/paste from pidgin)
Richard Nelson <wabz@pidgin.im>
parents:
17164
diff
changeset
|
82 | return FALSE; |
|
4db9d9d3e928
Finch autoreconnecting (largely copy/paste from pidgin)
Richard Nelson <wabz@pidgin.im>
parents:
17164
diff
changeset
|
83 | } |
|
4db9d9d3e928
Finch autoreconnecting (largely copy/paste from pidgin)
Richard Nelson <wabz@pidgin.im>
parents:
17164
diff
changeset
|
84 | |
|
14014
223d99ce2f06
[gaim-migrate @ 16500]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
85 | static void |
|
22336
ac905bb0a8ec
Add accessor and update finch to not touch the internals of PurpleConnection.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
21756
diff
changeset
|
86 | finch_connection_report_disconnect(PurpleConnection *gc, PurpleConnectionError reason, |
|
ac905bb0a8ec
Add accessor and update finch to not touch the internals of PurpleConnection.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
21756
diff
changeset
|
87 | const char *text) |
|
14014
223d99ce2f06
[gaim-migrate @ 16500]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
88 | { |
|
17401
4db9d9d3e928
Finch autoreconnecting (largely copy/paste from pidgin)
Richard Nelson <wabz@pidgin.im>
parents:
17164
diff
changeset
|
89 | FinchAutoRecon *info; |
| 15884 | 90 | PurpleAccount *account = purple_connection_get_account(gc); |
|
14014
223d99ce2f06
[gaim-migrate @ 16500]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
91 | |
|
22336
ac905bb0a8ec
Add accessor and update finch to not touch the internals of PurpleConnection.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
21756
diff
changeset
|
92 | if (!purple_connection_error_is_fatal(reason)) { |
|
20315
21fbfe31160a
If there's a chat open when an account gets disconnected because of an error,
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
19969
diff
changeset
|
93 | info = g_hash_table_lookup(hash, account); |
|
21fbfe31160a
If there's a chat open when an account gets disconnected because of an error,
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
19969
diff
changeset
|
94 | |
|
17401
4db9d9d3e928
Finch autoreconnecting (largely copy/paste from pidgin)
Richard Nelson <wabz@pidgin.im>
parents:
17164
diff
changeset
|
95 | if (info == NULL) { |
|
4db9d9d3e928
Finch autoreconnecting (largely copy/paste from pidgin)
Richard Nelson <wabz@pidgin.im>
parents:
17164
diff
changeset
|
96 | info = g_new0(FinchAutoRecon, 1); |
|
4db9d9d3e928
Finch autoreconnecting (largely copy/paste from pidgin)
Richard Nelson <wabz@pidgin.im>
parents:
17164
diff
changeset
|
97 | g_hash_table_insert(hash, account, info); |
|
4db9d9d3e928
Finch autoreconnecting (largely copy/paste from pidgin)
Richard Nelson <wabz@pidgin.im>
parents:
17164
diff
changeset
|
98 | info->delay = g_random_int_range(INITIAL_RECON_DELAY_MIN, INITIAL_RECON_DELAY_MAX); |
|
4db9d9d3e928
Finch autoreconnecting (largely copy/paste from pidgin)
Richard Nelson <wabz@pidgin.im>
parents:
17164
diff
changeset
|
99 | } else { |
|
4db9d9d3e928
Finch autoreconnecting (largely copy/paste from pidgin)
Richard Nelson <wabz@pidgin.im>
parents:
17164
diff
changeset
|
100 | info->delay = MIN(2 * info->delay, MAX_RECON_DELAY); |
|
4db9d9d3e928
Finch autoreconnecting (largely copy/paste from pidgin)
Richard Nelson <wabz@pidgin.im>
parents:
17164
diff
changeset
|
101 | if (info->timeout != 0) |
|
4db9d9d3e928
Finch autoreconnecting (largely copy/paste from pidgin)
Richard Nelson <wabz@pidgin.im>
parents:
17164
diff
changeset
|
102 | g_source_remove(info->timeout); |
|
4db9d9d3e928
Finch autoreconnecting (largely copy/paste from pidgin)
Richard Nelson <wabz@pidgin.im>
parents:
17164
diff
changeset
|
103 | } |
|
40412
c0905847d779
Use g_timeout_add_seconds some more.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
40359
diff
changeset
|
104 | info->timeout = g_timeout_add_seconds(info->delay, do_signon, account); |
|
17401
4db9d9d3e928
Finch autoreconnecting (largely copy/paste from pidgin)
Richard Nelson <wabz@pidgin.im>
parents:
17164
diff
changeset
|
105 | } else { |
|
41392
b5c84f55d5d2
Remove the ui parameter from purple_account_[gs]et_enabled
Gary Kramlich <grim@reaperworld.com>
parents:
41314
diff
changeset
|
106 | purple_account_set_enabled(account, FALSE); |
|
17401
4db9d9d3e928
Finch autoreconnecting (largely copy/paste from pidgin)
Richard Nelson <wabz@pidgin.im>
parents:
17164
diff
changeset
|
107 | } |
|
4db9d9d3e928
Finch autoreconnecting (largely copy/paste from pidgin)
Richard Nelson <wabz@pidgin.im>
parents:
17164
diff
changeset
|
108 | } |
|
14014
223d99ce2f06
[gaim-migrate @ 16500]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
109 | |
|
17401
4db9d9d3e928
Finch autoreconnecting (largely copy/paste from pidgin)
Richard Nelson <wabz@pidgin.im>
parents:
17164
diff
changeset
|
110 | static void |
|
4db9d9d3e928
Finch autoreconnecting (largely copy/paste from pidgin)
Richard Nelson <wabz@pidgin.im>
parents:
17164
diff
changeset
|
111 | account_removed_cb(PurpleAccount *account, gpointer user_data) |
|
4db9d9d3e928
Finch autoreconnecting (largely copy/paste from pidgin)
Richard Nelson <wabz@pidgin.im>
parents:
17164
diff
changeset
|
112 | { |
|
4db9d9d3e928
Finch autoreconnecting (largely copy/paste from pidgin)
Richard Nelson <wabz@pidgin.im>
parents:
17164
diff
changeset
|
113 | g_hash_table_remove(hash, account); |
|
4db9d9d3e928
Finch autoreconnecting (largely copy/paste from pidgin)
Richard Nelson <wabz@pidgin.im>
parents:
17164
diff
changeset
|
114 | } |
|
4db9d9d3e928
Finch autoreconnecting (largely copy/paste from pidgin)
Richard Nelson <wabz@pidgin.im>
parents:
17164
diff
changeset
|
115 | |
|
4db9d9d3e928
Finch autoreconnecting (largely copy/paste from pidgin)
Richard Nelson <wabz@pidgin.im>
parents:
17164
diff
changeset
|
116 | static void * |
|
4db9d9d3e928
Finch autoreconnecting (largely copy/paste from pidgin)
Richard Nelson <wabz@pidgin.im>
parents:
17164
diff
changeset
|
117 | finch_connection_get_handle(void) |
|
4db9d9d3e928
Finch autoreconnecting (largely copy/paste from pidgin)
Richard Nelson <wabz@pidgin.im>
parents:
17164
diff
changeset
|
118 | { |
|
4db9d9d3e928
Finch autoreconnecting (largely copy/paste from pidgin)
Richard Nelson <wabz@pidgin.im>
parents:
17164
diff
changeset
|
119 | static int handle; |
|
4db9d9d3e928
Finch autoreconnecting (largely copy/paste from pidgin)
Richard Nelson <wabz@pidgin.im>
parents:
17164
diff
changeset
|
120 | |
|
4db9d9d3e928
Finch autoreconnecting (largely copy/paste from pidgin)
Richard Nelson <wabz@pidgin.im>
parents:
17164
diff
changeset
|
121 | return &handle; |
|
14014
223d99ce2f06
[gaim-migrate @ 16500]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
122 | } |
|
223d99ce2f06
[gaim-migrate @ 16500]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
123 | |
|
31294
73607ab89c6f
Remove trailing whitespace
Richard Laager <rlaager@pidgin.im>
parents:
29106
diff
changeset
|
124 | static PurpleConnectionUiOps ops = |
|
14014
223d99ce2f06
[gaim-migrate @ 16500]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
125 | { |
|
17164
3a005b9e8f28
Death to more futuristic struct initialization. This should be the last.
Richard Laager <rlaager@pidgin.im>
parents:
16490
diff
changeset
|
126 | NULL, /* connect_progress */ |
|
3a005b9e8f28
Death to more futuristic struct initialization. This should be the last.
Richard Laager <rlaager@pidgin.im>
parents:
16490
diff
changeset
|
127 | NULL, /* connected */ |
|
3a005b9e8f28
Death to more futuristic struct initialization. This should be the last.
Richard Laager <rlaager@pidgin.im>
parents:
16490
diff
changeset
|
128 | NULL, /* disconnected */ |
|
3a005b9e8f28
Death to more futuristic struct initialization. This should be the last.
Richard Laager <rlaager@pidgin.im>
parents:
16490
diff
changeset
|
129 | NULL, /* notice */ |
|
3a005b9e8f28
Death to more futuristic struct initialization. This should be the last.
Richard Laager <rlaager@pidgin.im>
parents:
16490
diff
changeset
|
130 | NULL, /* network_connected */ |
|
3a005b9e8f28
Death to more futuristic struct initialization. This should be the last.
Richard Laager <rlaager@pidgin.im>
parents:
16490
diff
changeset
|
131 | NULL, /* network_disconnected */ |
|
22336
ac905bb0a8ec
Add accessor and update finch to not touch the internals of PurpleConnection.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
21756
diff
changeset
|
132 | finch_connection_report_disconnect, |
|
17164
3a005b9e8f28
Death to more futuristic struct initialization. This should be the last.
Richard Laager <rlaager@pidgin.im>
parents:
16490
diff
changeset
|
133 | NULL, |
|
3a005b9e8f28
Death to more futuristic struct initialization. This should be the last.
Richard Laager <rlaager@pidgin.im>
parents:
16490
diff
changeset
|
134 | NULL, |
|
34906
6f5e8a7bfe8c
Initialized new padding member in connection UI ops
Ankit Vani <a@nevitus.org>
parents:
32152
diff
changeset
|
135 | NULL, |
|
17164
3a005b9e8f28
Death to more futuristic struct initialization. This should be the last.
Richard Laager <rlaager@pidgin.im>
parents:
16490
diff
changeset
|
136 | NULL |
|
14014
223d99ce2f06
[gaim-migrate @ 16500]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
137 | }; |
|
223d99ce2f06
[gaim-migrate @ 16500]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
138 | |
| 15884 | 139 | PurpleConnectionUiOps *finch_connections_get_ui_ops() |
|
14014
223d99ce2f06
[gaim-migrate @ 16500]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
140 | { |
|
223d99ce2f06
[gaim-migrate @ 16500]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
141 | return &ops; |
|
223d99ce2f06
[gaim-migrate @ 16500]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
142 | } |
|
223d99ce2f06
[gaim-migrate @ 16500]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
143 | |
|
15878
f52832b611fe
renamed gaim-text to finch
Sean Egan <seanegan@pidgin.im>
parents:
15781
diff
changeset
|
144 | void finch_connections_init() |
|
17401
4db9d9d3e928
Finch autoreconnecting (largely copy/paste from pidgin)
Richard Nelson <wabz@pidgin.im>
parents:
17164
diff
changeset
|
145 | { |
|
4db9d9d3e928
Finch autoreconnecting (largely copy/paste from pidgin)
Richard Nelson <wabz@pidgin.im>
parents:
17164
diff
changeset
|
146 | hash = g_hash_table_new_full( |
|
4db9d9d3e928
Finch autoreconnecting (largely copy/paste from pidgin)
Richard Nelson <wabz@pidgin.im>
parents:
17164
diff
changeset
|
147 | g_direct_hash, g_direct_equal, |
|
4db9d9d3e928
Finch autoreconnecting (largely copy/paste from pidgin)
Richard Nelson <wabz@pidgin.im>
parents:
17164
diff
changeset
|
148 | NULL, free_auto_recon); |
|
4db9d9d3e928
Finch autoreconnecting (largely copy/paste from pidgin)
Richard Nelson <wabz@pidgin.im>
parents:
17164
diff
changeset
|
149 | |
|
4db9d9d3e928
Finch autoreconnecting (largely copy/paste from pidgin)
Richard Nelson <wabz@pidgin.im>
parents:
17164
diff
changeset
|
150 | purple_signal_connect(purple_accounts_get_handle(), "account-removed", |
|
4db9d9d3e928
Finch autoreconnecting (largely copy/paste from pidgin)
Richard Nelson <wabz@pidgin.im>
parents:
17164
diff
changeset
|
151 | finch_connection_get_handle(), |
|
41314
0dc72eacd8bf
Replace PURPLE_CALLBACK by G_CALLBACK
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
40616
diff
changeset
|
152 | G_CALLBACK(account_removed_cb), NULL); |
|
17401
4db9d9d3e928
Finch autoreconnecting (largely copy/paste from pidgin)
Richard Nelson <wabz@pidgin.im>
parents:
17164
diff
changeset
|
153 | } |
|
14014
223d99ce2f06
[gaim-migrate @ 16500]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
154 | |
|
15878
f52832b611fe
renamed gaim-text to finch
Sean Egan <seanegan@pidgin.im>
parents:
15781
diff
changeset
|
155 | void finch_connections_uninit() |
|
17401
4db9d9d3e928
Finch autoreconnecting (largely copy/paste from pidgin)
Richard Nelson <wabz@pidgin.im>
parents:
17164
diff
changeset
|
156 | { |
|
4db9d9d3e928
Finch autoreconnecting (largely copy/paste from pidgin)
Richard Nelson <wabz@pidgin.im>
parents:
17164
diff
changeset
|
157 | purple_signals_disconnect_by_handle(finch_connection_get_handle()); |
|
4db9d9d3e928
Finch autoreconnecting (largely copy/paste from pidgin)
Richard Nelson <wabz@pidgin.im>
parents:
17164
diff
changeset
|
158 | g_hash_table_destroy(hash); |
|
4db9d9d3e928
Finch autoreconnecting (largely copy/paste from pidgin)
Richard Nelson <wabz@pidgin.im>
parents:
17164
diff
changeset
|
159 | } |