Sat, 27 Aug 2016 18:16:01 -0500
connection: Add purple_connection_take_error()
This patch adds a purple_connection_take_error() function, which
is functionally equivalent to purple_connection_g_error(), except
that it takes ownership of the passed GError.
This is useful to simplify error handling so that the GError doesn't
have to be freed, or, in the future potentially copied, if it's no
longer needed where it's generated. It can also allow for GErrors
being generated without storing them in a variable. This would be
reasonably common if/when all PurpleConnection errors are passed
in via GError.
| 6485 | 1 | /* |
| 2 | * Signals test plugin. | |
| 3 | * | |
| 4 | * Copyright (C) 2003 Christian Hammond. | |
| 5 | * | |
| 6 | * This program is free software; you can redistribute it and/or | |
| 7 | * modify it under the terms of the GNU General Public License as | |
| 8 | * published by the Free Software Foundation; either version 2 of the | |
| 9 | * License, or (at your option) any later version. | |
| 10 | * | |
| 11 | * This program is distributed in the hope that it will be useful, but | |
| 12 | * WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
| 14 | * General Public License for more details. | |
| 15 | * | |
| 16 | * You should have received a copy of the GNU General Public License | |
| 17 | * 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:
18976
diff
changeset
|
18 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA |
|
71d37b57eff2
The FSF changed its address a while ago; our files were out of date.
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
18976
diff
changeset
|
19 | * 02111-1301, USA. |
| 6485 | 20 | */ |
| 21 | #define SIGNAL_TEST_PLUGIN_ID "core-signals-test" | |
| 22 | ||
|
28981
4e3922ab4844
Include 'internal.h' before all other headers to make some non-gcc compilers happy.
Paul Aurich <darkrain42@pidgin.im>
parents:
27226
diff
changeset
|
23 | #include "internal.h" |
|
4e3922ab4844
Include 'internal.h' before all other headers to make some non-gcc compilers happy.
Paul Aurich <darkrain42@pidgin.im>
parents:
27226
diff
changeset
|
24 | |
| 6485 | 25 | #include <stdio.h> |
| 26 | ||
| 27 | #include "connection.h" | |
| 28 | #include "conversation.h" | |
| 29 | #include "core.h" | |
| 30 | #include "debug.h" | |
|
34910
60502558e400
Replacements for the GObject Xfer API
Ankit Vani <a@nevitus.org>
parents:
34889
diff
changeset
|
31 | #include "xfer.h" |
| 6485 | 32 | #include "signals.h" |
| 9954 | 33 | #include "version.h" |
|
11628
cdd5df7cfbc1
[gaim-migrate @ 13903]
Casey Harkins <charkins@pidgin.im>
parents:
11516
diff
changeset
|
34 | #include "status.h" |
| 12291 | 35 | #include "sound.h" |
| 6485 | 36 | |
| 37 | /************************************************************************** | |
| 38 | * Account subsystem signal callbacks | |
| 39 | **************************************************************************/ | |
| 40 | static void | |
| 15884 | 41 | account_connecting_cb(PurpleAccount *account, void *data) |
| 6485 | 42 | { |
| 15884 | 43 | purple_debug_misc("signals test", "account-connecting (%s)\n", |
| 44 | purple_account_get_username(account)); | |
| 6485 | 45 | } |
| 46 | ||
| 47 | static void | |
| 15884 | 48 | account_setting_info_cb(PurpleAccount *account, const char *info, void *data) |
| 6485 | 49 | { |
| 15884 | 50 | purple_debug_misc("signals test", "account-setting-info (%s, %s)\n", |
| 51 | purple_account_get_username(account), info); | |
| 6485 | 52 | } |
| 53 | ||
| 54 | static void | |
| 15884 | 55 | account_set_info_cb(PurpleAccount *account, const char *info, void *data) |
| 6485 | 56 | { |
| 15884 | 57 | purple_debug_misc("signals test", "account-set-info (%s, %s)\n", |
| 58 | purple_account_get_username(account), info); | |
| 6485 | 59 | } |
| 60 | ||
|
11628
cdd5df7cfbc1
[gaim-migrate @ 13903]
Casey Harkins <charkins@pidgin.im>
parents:
11516
diff
changeset
|
61 | static void |
| 15884 | 62 | account_status_changed(PurpleAccount *account, PurpleStatus *old, PurpleStatus *new, |
|
11628
cdd5df7cfbc1
[gaim-migrate @ 13903]
Casey Harkins <charkins@pidgin.im>
parents:
11516
diff
changeset
|
63 | gpointer data) |
|
cdd5df7cfbc1
[gaim-migrate @ 13903]
Casey Harkins <charkins@pidgin.im>
parents:
11516
diff
changeset
|
64 | { |
| 15884 | 65 | purple_debug_misc("signals test", "account-status-changed (%s, %s, %s)\n", |
| 66 | purple_account_get_username(account), | |
| 67 | purple_status_get_name(old), | |
| 68 | purple_status_get_name(new)); | |
|
11628
cdd5df7cfbc1
[gaim-migrate @ 13903]
Casey Harkins <charkins@pidgin.im>
parents:
11516
diff
changeset
|
69 | } |
|
cdd5df7cfbc1
[gaim-migrate @ 13903]
Casey Harkins <charkins@pidgin.im>
parents:
11516
diff
changeset
|
70 | |
|
13282
83e33fe74de3
[gaim-migrate @ 15647]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
13234
diff
changeset
|
71 | static void |
| 15884 | 72 | account_alias_changed(PurpleAccount *account, const char *old, gpointer data) |
|
13282
83e33fe74de3
[gaim-migrate @ 15647]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
13234
diff
changeset
|
73 | { |
| 15884 | 74 | purple_debug_misc("signals test", "account-alias-changed (%s, %s, %s)\n", |
| 75 | purple_account_get_username(account), | |
|
34589
428e92c79631
Renamed purple_account_[get,set]_alias to purple_account[get,set]_private_alias.
Ankit Vani <a@nevitus.org>
parents:
34567
diff
changeset
|
76 | old, purple_account_get_private_alias(account)); |
|
13282
83e33fe74de3
[gaim-migrate @ 15647]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
13234
diff
changeset
|
77 | } |
|
83e33fe74de3
[gaim-migrate @ 15647]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
13234
diff
changeset
|
78 | |
|
20421
e6c82f6c2485
Authorization signals. Modified patch from cockroach. Closes #1061.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
19859
diff
changeset
|
79 | static int |
|
33688
9454bda83147
Add response message to authorization signals.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33686
diff
changeset
|
80 | account_authorization_requested_cb(PurpleAccount *account, const char *user, const char *message, char *response, gpointer data) |
|
20421
e6c82f6c2485
Authorization signals. Modified patch from cockroach. Closes #1061.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
19859
diff
changeset
|
81 | { |
|
33686
0f6df320414b
Remove duplicate account-authorization-requested-with-message signal.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
30708
diff
changeset
|
82 | purple_debug_misc("signals test", "account-authorization-requested (%s, %s, %s)\n", |
|
0f6df320414b
Remove duplicate account-authorization-requested-with-message signal.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
30708
diff
changeset
|
83 | purple_account_get_username(account), user, message); |
|
0f6df320414b
Remove duplicate account-authorization-requested-with-message signal.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
30708
diff
changeset
|
84 | return PURPLE_ACCOUNT_RESPONSE_PASS; |
|
20421
e6c82f6c2485
Authorization signals. Modified patch from cockroach. Closes #1061.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
19859
diff
changeset
|
85 | } |
|
e6c82f6c2485
Authorization signals. Modified patch from cockroach. Closes #1061.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
19859
diff
changeset
|
86 | |
|
e6c82f6c2485
Authorization signals. Modified patch from cockroach. Closes #1061.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
19859
diff
changeset
|
87 | static void |
|
33688
9454bda83147
Add response message to authorization signals.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33686
diff
changeset
|
88 | account_authorization_granted_cb(PurpleAccount *account, const char *user, const char *message, gpointer data) |
|
20421
e6c82f6c2485
Authorization signals. Modified patch from cockroach. Closes #1061.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
19859
diff
changeset
|
89 | { |
|
33688
9454bda83147
Add response message to authorization signals.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33686
diff
changeset
|
90 | purple_debug_misc("signals test", "account-authorization-granted (%s, %s, %s)\n", |
|
9454bda83147
Add response message to authorization signals.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33686
diff
changeset
|
91 | purple_account_get_username(account), user, message); |
|
20421
e6c82f6c2485
Authorization signals. Modified patch from cockroach. Closes #1061.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
19859
diff
changeset
|
92 | } |
|
e6c82f6c2485
Authorization signals. Modified patch from cockroach. Closes #1061.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
19859
diff
changeset
|
93 | |
|
e6c82f6c2485
Authorization signals. Modified patch from cockroach. Closes #1061.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
19859
diff
changeset
|
94 | static void |
|
33688
9454bda83147
Add response message to authorization signals.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33686
diff
changeset
|
95 | account_authorization_denied_cb(PurpleAccount *account, const char *user, const char *message, gpointer data) |
|
20421
e6c82f6c2485
Authorization signals. Modified patch from cockroach. Closes #1061.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
19859
diff
changeset
|
96 | { |
|
33688
9454bda83147
Add response message to authorization signals.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33686
diff
changeset
|
97 | purple_debug_misc("signals test", "account-authorization-denied (%s, %s, %s)\n", |
|
9454bda83147
Add response message to authorization signals.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33686
diff
changeset
|
98 | purple_account_get_username(account), user, message); |
|
20421
e6c82f6c2485
Authorization signals. Modified patch from cockroach. Closes #1061.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
19859
diff
changeset
|
99 | } |
|
e6c82f6c2485
Authorization signals. Modified patch from cockroach. Closes #1061.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
19859
diff
changeset
|
100 | |
| 6485 | 101 | /************************************************************************** |
|
10934
439124978a9a
[gaim-migrate @ 12717]
Richard Laager <rlaager@pidgin.im>
parents:
10684
diff
changeset
|
102 | * Buddy Icons signal callbacks |
|
439124978a9a
[gaim-migrate @ 12717]
Richard Laager <rlaager@pidgin.im>
parents:
10684
diff
changeset
|
103 | **************************************************************************/ |
|
439124978a9a
[gaim-migrate @ 12717]
Richard Laager <rlaager@pidgin.im>
parents:
10684
diff
changeset
|
104 | static void |
| 15884 | 105 | buddy_icon_changed_cb(PurpleBuddy *buddy) |
|
10934
439124978a9a
[gaim-migrate @ 12717]
Richard Laager <rlaager@pidgin.im>
parents:
10684
diff
changeset
|
106 | { |
| 15884 | 107 | purple_debug_misc("signals test", "buddy icon changed (%s)\n", |
| 108 | purple_buddy_get_name(buddy)); | |
|
10934
439124978a9a
[gaim-migrate @ 12717]
Richard Laager <rlaager@pidgin.im>
parents:
10684
diff
changeset
|
109 | } |
|
439124978a9a
[gaim-migrate @ 12717]
Richard Laager <rlaager@pidgin.im>
parents:
10684
diff
changeset
|
110 | |
|
439124978a9a
[gaim-migrate @ 12717]
Richard Laager <rlaager@pidgin.im>
parents:
10684
diff
changeset
|
111 | /************************************************************************** |
| 6485 | 112 | * Buddy List subsystem signal callbacks |
| 113 | **************************************************************************/ | |
| 114 | static void | |
| 15884 | 115 | buddy_status_changed_cb(PurpleBuddy *buddy, PurpleStatus *old_status, |
| 116 | PurpleStatus *status, void *data) | |
| 6485 | 117 | { |
| 15884 | 118 | purple_debug_misc("signals test", "buddy-status-changed (%s %s to %s)\n", |
|
24531
76e72697f7d6
Hide the blistnode, buddy, contact, group, and chat structs
Gary Kramlich <grim@reaperworld.com>
parents:
21503
diff
changeset
|
119 | purple_buddy_get_name(buddy), |
|
76e72697f7d6
Hide the blistnode, buddy, contact, group, and chat structs
Gary Kramlich <grim@reaperworld.com>
parents:
21503
diff
changeset
|
120 | purple_status_get_id(old_status), |
|
76e72697f7d6
Hide the blistnode, buddy, contact, group, and chat structs
Gary Kramlich <grim@reaperworld.com>
parents:
21503
diff
changeset
|
121 | purple_status_get_id(status)); |
| 6485 | 122 | } |
| 123 | ||
| 124 | static void | |
| 15884 | 125 | buddy_idle_changed_cb(PurpleBuddy *buddy, gboolean old_idle, gboolean idle, |
| 11935 | 126 | void *data) |
| 6485 | 127 | { |
| 15884 | 128 | purple_debug_misc("signals test", "buddy-idle-changed (%s %s)\n", |
|
24531
76e72697f7d6
Hide the blistnode, buddy, contact, group, and chat structs
Gary Kramlich <grim@reaperworld.com>
parents:
21503
diff
changeset
|
129 | purple_buddy_get_name(buddy), |
|
76e72697f7d6
Hide the blistnode, buddy, contact, group, and chat structs
Gary Kramlich <grim@reaperworld.com>
parents:
21503
diff
changeset
|
130 | old_idle ? "unidled" : "idled"); |
| 6485 | 131 | } |
| 132 | ||
| 133 | static void | |
| 15884 | 134 | buddy_signed_on_cb(PurpleBuddy *buddy, void *data) |
| 6485 | 135 | { |
|
24531
76e72697f7d6
Hide the blistnode, buddy, contact, group, and chat structs
Gary Kramlich <grim@reaperworld.com>
parents:
21503
diff
changeset
|
136 | purple_debug_misc("signals test", "buddy-signed-on (%s)\n", |
|
76e72697f7d6
Hide the blistnode, buddy, contact, group, and chat structs
Gary Kramlich <grim@reaperworld.com>
parents:
21503
diff
changeset
|
137 | purple_buddy_get_name(buddy)); |
| 6485 | 138 | } |
| 139 | ||
| 140 | static void | |
| 15884 | 141 | buddy_signed_off_cb(PurpleBuddy *buddy, void *data) |
| 6485 | 142 | { |
|
24531
76e72697f7d6
Hide the blistnode, buddy, contact, group, and chat structs
Gary Kramlich <grim@reaperworld.com>
parents:
21503
diff
changeset
|
143 | purple_debug_misc("signals test", "buddy-signed-off (%s)\n", |
|
76e72697f7d6
Hide the blistnode, buddy, contact, group, and chat structs
Gary Kramlich <grim@reaperworld.com>
parents:
21503
diff
changeset
|
144 | purple_buddy_get_name(buddy)); |
| 6485 | 145 | } |
| 146 | ||
| 8999 | 147 | static void |
|
27023
f7d6ee5315c9
Add blist-node-(added|removed) and deprecate buddy-(added|removed). Closes #8309
Paul Aurich <darkrain42@pidgin.im>
parents:
24531
diff
changeset
|
148 | blist_node_added_cb(PurpleBlistNode *bnode, void *data) |
|
11454
a604c2097a6e
[gaim-migrate @ 13693]
Richard Laager <rlaager@pidgin.im>
parents:
11281
diff
changeset
|
149 | { |
|
27023
f7d6ee5315c9
Add blist-node-(added|removed) and deprecate buddy-(added|removed). Closes #8309
Paul Aurich <darkrain42@pidgin.im>
parents:
24531
diff
changeset
|
150 | const char *name; |
|
34695
60a278f1365b
Refactored libpurple plugins with initial GObject blist API
Ankit Vani <a@nevitus.org>
parents:
34670
diff
changeset
|
151 | if (PURPLE_IS_GROUP(bnode)) |
|
27023
f7d6ee5315c9
Add blist-node-(added|removed) and deprecate buddy-(added|removed). Closes #8309
Paul Aurich <darkrain42@pidgin.im>
parents:
24531
diff
changeset
|
152 | name = purple_group_get_name(PURPLE_GROUP(bnode)); |
|
34695
60a278f1365b
Refactored libpurple plugins with initial GObject blist API
Ankit Vani <a@nevitus.org>
parents:
34670
diff
changeset
|
153 | else if (PURPLE_IS_CONTACT(bnode)) |
|
27023
f7d6ee5315c9
Add blist-node-(added|removed) and deprecate buddy-(added|removed). Closes #8309
Paul Aurich <darkrain42@pidgin.im>
parents:
24531
diff
changeset
|
154 | /* Close enough */ |
|
f7d6ee5315c9
Add blist-node-(added|removed) and deprecate buddy-(added|removed). Closes #8309
Paul Aurich <darkrain42@pidgin.im>
parents:
24531
diff
changeset
|
155 | name = purple_contact_get_alias(PURPLE_CONTACT(bnode)); |
|
34695
60a278f1365b
Refactored libpurple plugins with initial GObject blist API
Ankit Vani <a@nevitus.org>
parents:
34670
diff
changeset
|
156 | else if (PURPLE_IS_BUDDY(bnode)) |
|
27023
f7d6ee5315c9
Add blist-node-(added|removed) and deprecate buddy-(added|removed). Closes #8309
Paul Aurich <darkrain42@pidgin.im>
parents:
24531
diff
changeset
|
157 | name = purple_buddy_get_name(PURPLE_BUDDY(bnode)); |
|
f7d6ee5315c9
Add blist-node-(added|removed) and deprecate buddy-(added|removed). Closes #8309
Paul Aurich <darkrain42@pidgin.im>
parents:
24531
diff
changeset
|
158 | else |
|
f7d6ee5315c9
Add blist-node-(added|removed) and deprecate buddy-(added|removed). Closes #8309
Paul Aurich <darkrain42@pidgin.im>
parents:
24531
diff
changeset
|
159 | name = "(unknown)"; |
|
f7d6ee5315c9
Add blist-node-(added|removed) and deprecate buddy-(added|removed). Closes #8309
Paul Aurich <darkrain42@pidgin.im>
parents:
24531
diff
changeset
|
160 | |
|
f7d6ee5315c9
Add blist-node-(added|removed) and deprecate buddy-(added|removed). Closes #8309
Paul Aurich <darkrain42@pidgin.im>
parents:
24531
diff
changeset
|
161 | purple_debug_misc("signals test", "blist_node_added_cb (%s)\n", |
|
f7d6ee5315c9
Add blist-node-(added|removed) and deprecate buddy-(added|removed). Closes #8309
Paul Aurich <darkrain42@pidgin.im>
parents:
24531
diff
changeset
|
162 | name ? name : "(null)"); |
|
11454
a604c2097a6e
[gaim-migrate @ 13693]
Richard Laager <rlaager@pidgin.im>
parents:
11281
diff
changeset
|
163 | } |
|
a604c2097a6e
[gaim-migrate @ 13693]
Richard Laager <rlaager@pidgin.im>
parents:
11281
diff
changeset
|
164 | |
|
a604c2097a6e
[gaim-migrate @ 13693]
Richard Laager <rlaager@pidgin.im>
parents:
11281
diff
changeset
|
165 | static void |
|
27023
f7d6ee5315c9
Add blist-node-(added|removed) and deprecate buddy-(added|removed). Closes #8309
Paul Aurich <darkrain42@pidgin.im>
parents:
24531
diff
changeset
|
166 | blist_node_removed_cb(PurpleBlistNode *bnode, void *data) |
|
11454
a604c2097a6e
[gaim-migrate @ 13693]
Richard Laager <rlaager@pidgin.im>
parents:
11281
diff
changeset
|
167 | { |
|
27023
f7d6ee5315c9
Add blist-node-(added|removed) and deprecate buddy-(added|removed). Closes #8309
Paul Aurich <darkrain42@pidgin.im>
parents:
24531
diff
changeset
|
168 | const char *name; |
|
34695
60a278f1365b
Refactored libpurple plugins with initial GObject blist API
Ankit Vani <a@nevitus.org>
parents:
34670
diff
changeset
|
169 | if (PURPLE_IS_GROUP(bnode)) |
|
27023
f7d6ee5315c9
Add blist-node-(added|removed) and deprecate buddy-(added|removed). Closes #8309
Paul Aurich <darkrain42@pidgin.im>
parents:
24531
diff
changeset
|
170 | name = purple_group_get_name(PURPLE_GROUP(bnode)); |
|
34695
60a278f1365b
Refactored libpurple plugins with initial GObject blist API
Ankit Vani <a@nevitus.org>
parents:
34670
diff
changeset
|
171 | else if (PURPLE_IS_CONTACT(bnode)) |
|
27023
f7d6ee5315c9
Add blist-node-(added|removed) and deprecate buddy-(added|removed). Closes #8309
Paul Aurich <darkrain42@pidgin.im>
parents:
24531
diff
changeset
|
172 | /* Close enough */ |
|
f7d6ee5315c9
Add blist-node-(added|removed) and deprecate buddy-(added|removed). Closes #8309
Paul Aurich <darkrain42@pidgin.im>
parents:
24531
diff
changeset
|
173 | name = purple_contact_get_alias(PURPLE_CONTACT(bnode)); |
|
34695
60a278f1365b
Refactored libpurple plugins with initial GObject blist API
Ankit Vani <a@nevitus.org>
parents:
34670
diff
changeset
|
174 | else if (PURPLE_IS_BUDDY(bnode)) |
|
27023
f7d6ee5315c9
Add blist-node-(added|removed) and deprecate buddy-(added|removed). Closes #8309
Paul Aurich <darkrain42@pidgin.im>
parents:
24531
diff
changeset
|
175 | name = purple_buddy_get_name(PURPLE_BUDDY(bnode)); |
|
f7d6ee5315c9
Add blist-node-(added|removed) and deprecate buddy-(added|removed). Closes #8309
Paul Aurich <darkrain42@pidgin.im>
parents:
24531
diff
changeset
|
176 | else |
|
f7d6ee5315c9
Add blist-node-(added|removed) and deprecate buddy-(added|removed). Closes #8309
Paul Aurich <darkrain42@pidgin.im>
parents:
24531
diff
changeset
|
177 | name = "(unknown)"; |
|
f7d6ee5315c9
Add blist-node-(added|removed) and deprecate buddy-(added|removed). Closes #8309
Paul Aurich <darkrain42@pidgin.im>
parents:
24531
diff
changeset
|
178 | |
|
f7d6ee5315c9
Add blist-node-(added|removed) and deprecate buddy-(added|removed). Closes #8309
Paul Aurich <darkrain42@pidgin.im>
parents:
24531
diff
changeset
|
179 | purple_debug_misc("signals test", "blist_node_removed_cb (%s)\n", |
|
f7d6ee5315c9
Add blist-node-(added|removed) and deprecate buddy-(added|removed). Closes #8309
Paul Aurich <darkrain42@pidgin.im>
parents:
24531
diff
changeset
|
180 | name ? name : "(null)"); |
|
11454
a604c2097a6e
[gaim-migrate @ 13693]
Richard Laager <rlaager@pidgin.im>
parents:
11281
diff
changeset
|
181 | } |
|
a604c2097a6e
[gaim-migrate @ 13693]
Richard Laager <rlaager@pidgin.im>
parents:
11281
diff
changeset
|
182 | |
|
a604c2097a6e
[gaim-migrate @ 13693]
Richard Laager <rlaager@pidgin.im>
parents:
11281
diff
changeset
|
183 | static void |
| 15884 | 184 | blist_node_aliased(PurpleBlistNode *node, const char *old_alias) |
|
11454
a604c2097a6e
[gaim-migrate @ 13693]
Richard Laager <rlaager@pidgin.im>
parents:
11281
diff
changeset
|
185 | { |
|
34740
9401f9b1ca68
Used GObject-style casts in plugins.
Ankit Vani <a@nevitus.org>
parents:
34699
diff
changeset
|
186 | PurpleContact *p = PURPLE_CONTACT(node); |
|
9401f9b1ca68
Used GObject-style casts in plugins.
Ankit Vani <a@nevitus.org>
parents:
34699
diff
changeset
|
187 | PurpleBuddy *b = PURPLE_BUDDY(node); |
|
9401f9b1ca68
Used GObject-style casts in plugins.
Ankit Vani <a@nevitus.org>
parents:
34699
diff
changeset
|
188 | PurpleChat *c = PURPLE_CHAT(node); |
|
9401f9b1ca68
Used GObject-style casts in plugins.
Ankit Vani <a@nevitus.org>
parents:
34699
diff
changeset
|
189 | PurpleGroup *g = PURPLE_GROUP(node); |
|
11454
a604c2097a6e
[gaim-migrate @ 13693]
Richard Laager <rlaager@pidgin.im>
parents:
11281
diff
changeset
|
190 | |
|
34695
60a278f1365b
Refactored libpurple plugins with initial GObject blist API
Ankit Vani <a@nevitus.org>
parents:
34670
diff
changeset
|
191 | if (PURPLE_IS_CONTACT(node)) { |
|
24531
76e72697f7d6
Hide the blistnode, buddy, contact, group, and chat structs
Gary Kramlich <grim@reaperworld.com>
parents:
21503
diff
changeset
|
192 | purple_debug_misc("signals test", |
|
76e72697f7d6
Hide the blistnode, buddy, contact, group, and chat structs
Gary Kramlich <grim@reaperworld.com>
parents:
21503
diff
changeset
|
193 | "blist-node-aliased (Contact: %s, %s)\n", |
|
76e72697f7d6
Hide the blistnode, buddy, contact, group, and chat structs
Gary Kramlich <grim@reaperworld.com>
parents:
21503
diff
changeset
|
194 | purple_contact_get_alias(p), old_alias); |
|
34695
60a278f1365b
Refactored libpurple plugins with initial GObject blist API
Ankit Vani <a@nevitus.org>
parents:
34670
diff
changeset
|
195 | } else if (PURPLE_IS_BUDDY(node)) { |
|
24531
76e72697f7d6
Hide the blistnode, buddy, contact, group, and chat structs
Gary Kramlich <grim@reaperworld.com>
parents:
21503
diff
changeset
|
196 | purple_debug_misc("signals test", |
|
76e72697f7d6
Hide the blistnode, buddy, contact, group, and chat structs
Gary Kramlich <grim@reaperworld.com>
parents:
21503
diff
changeset
|
197 | "blist-node-aliased (Buddy: %s, %s)\n", |
|
76e72697f7d6
Hide the blistnode, buddy, contact, group, and chat structs
Gary Kramlich <grim@reaperworld.com>
parents:
21503
diff
changeset
|
198 | purple_buddy_get_name(b), old_alias); |
|
34695
60a278f1365b
Refactored libpurple plugins with initial GObject blist API
Ankit Vani <a@nevitus.org>
parents:
34670
diff
changeset
|
199 | } else if (PURPLE_IS_CHAT(node)) { |
|
24531
76e72697f7d6
Hide the blistnode, buddy, contact, group, and chat structs
Gary Kramlich <grim@reaperworld.com>
parents:
21503
diff
changeset
|
200 | purple_debug_misc("signals test", |
|
76e72697f7d6
Hide the blistnode, buddy, contact, group, and chat structs
Gary Kramlich <grim@reaperworld.com>
parents:
21503
diff
changeset
|
201 | "blist-node-aliased (Chat: %s, %s)\n", |
|
76e72697f7d6
Hide the blistnode, buddy, contact, group, and chat structs
Gary Kramlich <grim@reaperworld.com>
parents:
21503
diff
changeset
|
202 | purple_chat_get_name(c), old_alias); |
|
34695
60a278f1365b
Refactored libpurple plugins with initial GObject blist API
Ankit Vani <a@nevitus.org>
parents:
34670
diff
changeset
|
203 | } else if (PURPLE_IS_GROUP(node)) { |
|
24531
76e72697f7d6
Hide the blistnode, buddy, contact, group, and chat structs
Gary Kramlich <grim@reaperworld.com>
parents:
21503
diff
changeset
|
204 | purple_debug_misc("signals test", |
|
76e72697f7d6
Hide the blistnode, buddy, contact, group, and chat structs
Gary Kramlich <grim@reaperworld.com>
parents:
21503
diff
changeset
|
205 | "blist-node-aliased (Group: %s, %s)\n", |
|
76e72697f7d6
Hide the blistnode, buddy, contact, group, and chat structs
Gary Kramlich <grim@reaperworld.com>
parents:
21503
diff
changeset
|
206 | purple_group_get_name(g), old_alias); |
|
76e72697f7d6
Hide the blistnode, buddy, contact, group, and chat structs
Gary Kramlich <grim@reaperworld.com>
parents:
21503
diff
changeset
|
207 | } |
|
11454
a604c2097a6e
[gaim-migrate @ 13693]
Richard Laager <rlaager@pidgin.im>
parents:
11281
diff
changeset
|
208 | } |
|
a604c2097a6e
[gaim-migrate @ 13693]
Richard Laager <rlaager@pidgin.im>
parents:
11281
diff
changeset
|
209 | |
|
a604c2097a6e
[gaim-migrate @ 13693]
Richard Laager <rlaager@pidgin.im>
parents:
11281
diff
changeset
|
210 | static void |
| 15884 | 211 | blist_node_extended_menu_cb(PurpleBlistNode *node, void *data) |
| 8999 | 212 | { |
|
34740
9401f9b1ca68
Used GObject-style casts in plugins.
Ankit Vani <a@nevitus.org>
parents:
34699
diff
changeset
|
213 | PurpleContact *p = PURPLE_CONTACT(node); |
|
9401f9b1ca68
Used GObject-style casts in plugins.
Ankit Vani <a@nevitus.org>
parents:
34699
diff
changeset
|
214 | PurpleBuddy *b = PURPLE_BUDDY(node); |
|
9401f9b1ca68
Used GObject-style casts in plugins.
Ankit Vani <a@nevitus.org>
parents:
34699
diff
changeset
|
215 | PurpleChat *c = PURPLE_CHAT(node); |
|
9401f9b1ca68
Used GObject-style casts in plugins.
Ankit Vani <a@nevitus.org>
parents:
34699
diff
changeset
|
216 | PurpleGroup *g = PURPLE_GROUP(node); |
| 8999 | 217 | |
|
34695
60a278f1365b
Refactored libpurple plugins with initial GObject blist API
Ankit Vani <a@nevitus.org>
parents:
34670
diff
changeset
|
218 | if (PURPLE_IS_CONTACT(node)) { |
|
24531
76e72697f7d6
Hide the blistnode, buddy, contact, group, and chat structs
Gary Kramlich <grim@reaperworld.com>
parents:
21503
diff
changeset
|
219 | purple_debug_misc("signals test", |
|
76e72697f7d6
Hide the blistnode, buddy, contact, group, and chat structs
Gary Kramlich <grim@reaperworld.com>
parents:
21503
diff
changeset
|
220 | "blist-node-extended-menu (Contact: %s)\n", |
|
76e72697f7d6
Hide the blistnode, buddy, contact, group, and chat structs
Gary Kramlich <grim@reaperworld.com>
parents:
21503
diff
changeset
|
221 | purple_contact_get_alias(p)); |
|
34695
60a278f1365b
Refactored libpurple plugins with initial GObject blist API
Ankit Vani <a@nevitus.org>
parents:
34670
diff
changeset
|
222 | } else if (PURPLE_IS_BUDDY(node)) { |
|
24531
76e72697f7d6
Hide the blistnode, buddy, contact, group, and chat structs
Gary Kramlich <grim@reaperworld.com>
parents:
21503
diff
changeset
|
223 | purple_debug_misc("signals test", |
|
76e72697f7d6
Hide the blistnode, buddy, contact, group, and chat structs
Gary Kramlich <grim@reaperworld.com>
parents:
21503
diff
changeset
|
224 | "blist-node-extended-menu (Buddy: %s)\n", |
|
76e72697f7d6
Hide the blistnode, buddy, contact, group, and chat structs
Gary Kramlich <grim@reaperworld.com>
parents:
21503
diff
changeset
|
225 | purple_buddy_get_name(b)); |
|
34695
60a278f1365b
Refactored libpurple plugins with initial GObject blist API
Ankit Vani <a@nevitus.org>
parents:
34670
diff
changeset
|
226 | } else if (PURPLE_IS_CHAT(node)) { |
|
24531
76e72697f7d6
Hide the blistnode, buddy, contact, group, and chat structs
Gary Kramlich <grim@reaperworld.com>
parents:
21503
diff
changeset
|
227 | purple_debug_misc("signals test", |
|
76e72697f7d6
Hide the blistnode, buddy, contact, group, and chat structs
Gary Kramlich <grim@reaperworld.com>
parents:
21503
diff
changeset
|
228 | "blist-node-extended-menu (Chat: %s)\n", |
|
76e72697f7d6
Hide the blistnode, buddy, contact, group, and chat structs
Gary Kramlich <grim@reaperworld.com>
parents:
21503
diff
changeset
|
229 | purple_chat_get_name(c)); |
|
34695
60a278f1365b
Refactored libpurple plugins with initial GObject blist API
Ankit Vani <a@nevitus.org>
parents:
34670
diff
changeset
|
230 | } else if (PURPLE_IS_GROUP(node)) { |
|
24531
76e72697f7d6
Hide the blistnode, buddy, contact, group, and chat structs
Gary Kramlich <grim@reaperworld.com>
parents:
21503
diff
changeset
|
231 | purple_debug_misc("signals test", |
|
76e72697f7d6
Hide the blistnode, buddy, contact, group, and chat structs
Gary Kramlich <grim@reaperworld.com>
parents:
21503
diff
changeset
|
232 | "blist-node-extended-menu (Group: %s)\n", |
|
76e72697f7d6
Hide the blistnode, buddy, contact, group, and chat structs
Gary Kramlich <grim@reaperworld.com>
parents:
21503
diff
changeset
|
233 | purple_group_get_name(g)); |
|
76e72697f7d6
Hide the blistnode, buddy, contact, group, and chat structs
Gary Kramlich <grim@reaperworld.com>
parents:
21503
diff
changeset
|
234 | } |
| 8999 | 235 | } |
| 236 | ||
| 237 | ||
| 6485 | 238 | /************************************************************************** |
| 239 | * Connection subsystem signal callbacks | |
| 240 | **************************************************************************/ | |
| 241 | static void | |
| 15884 | 242 | signing_on_cb(PurpleConnection *gc, void *data) |
| 6485 | 243 | { |
| 15884 | 244 | purple_debug_misc("signals test", "signing-on (%s)\n", |
| 245 | purple_account_get_username(purple_connection_get_account(gc))); | |
| 6485 | 246 | } |
| 247 | ||
| 248 | static void | |
| 15884 | 249 | signed_on_cb(PurpleConnection *gc, void *data) |
| 6485 | 250 | { |
| 15884 | 251 | purple_debug_misc("signals test", "signed-on (%s)\n", |
| 252 | purple_account_get_username(purple_connection_get_account(gc))); | |
| 6485 | 253 | } |
| 254 | ||
| 255 | static void | |
| 15884 | 256 | signing_off_cb(PurpleConnection *gc, void *data) |
| 6485 | 257 | { |
| 15884 | 258 | purple_debug_misc("signals test", "signing-off (%s)\n", |
| 259 | purple_account_get_username(purple_connection_get_account(gc))); | |
| 6485 | 260 | } |
| 261 | ||
| 262 | static void | |
| 15884 | 263 | signed_off_cb(PurpleConnection *gc, void *data) |
| 6485 | 264 | { |
| 15884 | 265 | purple_debug_misc("signals test", "signed-off (%s)\n", |
| 266 | purple_account_get_username(purple_connection_get_account(gc))); | |
| 6485 | 267 | } |
| 268 | ||
|
21285
ca8cb8706802
I figured a signal firing on a connection error would be useful.
Will Thompson <resiak@pidgin.im>
parents:
20421
diff
changeset
|
269 | static void |
|
ca8cb8706802
I figured a signal firing on a connection error would be useful.
Will Thompson <resiak@pidgin.im>
parents:
20421
diff
changeset
|
270 | connection_error_cb(PurpleConnection *gc, |
|
ca8cb8706802
I figured a signal firing on a connection error would be useful.
Will Thompson <resiak@pidgin.im>
parents:
20421
diff
changeset
|
271 | PurpleConnectionError err, |
|
ca8cb8706802
I figured a signal firing on a connection error would be useful.
Will Thompson <resiak@pidgin.im>
parents:
20421
diff
changeset
|
272 | const gchar *desc, |
|
ca8cb8706802
I figured a signal firing on a connection error would be useful.
Will Thompson <resiak@pidgin.im>
parents:
20421
diff
changeset
|
273 | void *data) |
|
ca8cb8706802
I figured a signal firing on a connection error would be useful.
Will Thompson <resiak@pidgin.im>
parents:
20421
diff
changeset
|
274 | { |
|
ca8cb8706802
I figured a signal firing on a connection error would be useful.
Will Thompson <resiak@pidgin.im>
parents:
20421
diff
changeset
|
275 | const gchar *username = |
|
ca8cb8706802
I figured a signal firing on a connection error would be useful.
Will Thompson <resiak@pidgin.im>
parents:
20421
diff
changeset
|
276 | purple_account_get_username(purple_connection_get_account(gc)); |
|
ca8cb8706802
I figured a signal firing on a connection error would be useful.
Will Thompson <resiak@pidgin.im>
parents:
20421
diff
changeset
|
277 | purple_debug_misc("signals test", "connection-error (%s, %u, %s)\n", |
|
ca8cb8706802
I figured a signal firing on a connection error would be useful.
Will Thompson <resiak@pidgin.im>
parents:
20421
diff
changeset
|
278 | username, err, desc); |
|
ca8cb8706802
I figured a signal firing on a connection error would be useful.
Will Thompson <resiak@pidgin.im>
parents:
20421
diff
changeset
|
279 | } |
|
ca8cb8706802
I figured a signal firing on a connection error would be useful.
Will Thompson <resiak@pidgin.im>
parents:
20421
diff
changeset
|
280 | |
| 6485 | 281 | /************************************************************************** |
| 282 | * Conversation subsystem signal callbacks | |
| 283 | **************************************************************************/ | |
| 284 | static gboolean | |
|
37481
ef7d5e45fe84
Fix a regression bug in signals-test.c
Koosha Khajehmoogahi <koosha@posteo.de>
parents:
37158
diff
changeset
|
285 | writing_im_msg_cb(PurpleConversation *conv, PurpleMessage *pmsg) |
| 9051 | 286 | { |
|
37481
ef7d5e45fe84
Fix a regression bug in signals-test.c
Koosha Khajehmoogahi <koosha@posteo.de>
parents:
37158
diff
changeset
|
287 | purple_debug_misc("signals test", "writing-im-msg (%s, %s)\n", |
|
ef7d5e45fe84
Fix a regression bug in signals-test.c
Koosha Khajehmoogahi <koosha@posteo.de>
parents:
37158
diff
changeset
|
288 | purple_conversation_get_name(conv), |
|
ef7d5e45fe84
Fix a regression bug in signals-test.c
Koosha Khajehmoogahi <koosha@posteo.de>
parents:
37158
diff
changeset
|
289 | purple_message_get_contents(pmsg)); |
| 9051 | 290 | |
| 291 | return FALSE; | |
| 292 | ||
| 293 | } | |
| 294 | ||
| 295 | static void | |
|
36108
69b4fce85ffa
Switch _purple_conversation_write_common and (writing|wrote)-(chat|im)-msg to PurpleMessage
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
36098
diff
changeset
|
296 | wrote_im_msg_cb(PurpleConversation *conv, PurpleMessage *msg, gpointer data) |
| 9051 | 297 | { |
|
36108
69b4fce85ffa
Switch _purple_conversation_write_common and (writing|wrote)-(chat|im)-msg to PurpleMessage
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
36098
diff
changeset
|
298 | purple_debug_misc("signals test", "wrote-im-msg (%s, %s)\n", |
|
69b4fce85ffa
Switch _purple_conversation_write_common and (writing|wrote)-(chat|im)-msg to PurpleMessage
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
36098
diff
changeset
|
299 | purple_conversation_get_name(conv), |
|
69b4fce85ffa
Switch _purple_conversation_write_common and (writing|wrote)-(chat|im)-msg to PurpleMessage
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
36098
diff
changeset
|
300 | purple_message_get_contents(msg)); |
| 9051 | 301 | } |
| 302 | ||
| 7503 | 303 | static void |
|
36079
2e449140fe0b
Switch sending-im-msg to PurpleMessage
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
34935
diff
changeset
|
304 | sending_im_msg_cb(PurpleAccount *account, PurpleMessage *msg, void *data) |
| 6485 | 305 | { |
| 15884 | 306 | purple_debug_misc("signals test", "sending-im-msg (%s, %s, %s)\n", |
|
36079
2e449140fe0b
Switch sending-im-msg to PurpleMessage
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
34935
diff
changeset
|
307 | purple_account_get_username(account), |
|
36098
4951752ad038
Split PurpleMessage into incoming, outgoing and system
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
36082
diff
changeset
|
308 | purple_message_get_recipient(msg), |
|
36079
2e449140fe0b
Switch sending-im-msg to PurpleMessage
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
34935
diff
changeset
|
309 | purple_message_get_contents(msg)); |
| 6485 | 310 | |
| 311 | } | |
| 312 | ||
| 313 | static void | |
|
36081
6764e037a308
Switch sent-im-msg to PurpleMessage
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
36080
diff
changeset
|
314 | sent_im_msg_cb(PurpleAccount *account, PurpleMessage *msg, void *data) |
| 6485 | 315 | { |
| 15884 | 316 | purple_debug_misc("signals test", "sent-im-msg (%s, %s, %s)\n", |
|
36081
6764e037a308
Switch sent-im-msg to PurpleMessage
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
36080
diff
changeset
|
317 | purple_account_get_username(account), |
|
36098
4951752ad038
Split PurpleMessage into incoming, outgoing and system
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
36082
diff
changeset
|
318 | purple_message_get_recipient(msg), |
|
36081
6764e037a308
Switch sent-im-msg to PurpleMessage
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
36080
diff
changeset
|
319 | purple_message_get_contents(msg)); |
| 6485 | 320 | } |
| 321 | ||
| 322 | static gboolean | |
| 15884 | 323 | receiving_im_msg_cb(PurpleAccount *account, char **sender, char **buffer, |
| 324 | PurpleConversation *conv, PurpleMessageFlags *flags, void *data) | |
| 6485 | 325 | { |
| 15884 | 326 | purple_debug_misc("signals test", "receiving-im-msg (%s, %s, %s, %s, %d)\n", |
| 327 | purple_account_get_username(account), *sender, *buffer, | |
| 328 | (conv != NULL) ? purple_conversation_get_name(conv) : "(null)", *flags); | |
| 6485 | 329 | |
| 330 | return FALSE; | |
| 331 | } | |
| 332 | ||
| 8999 | 333 | static void |
| 15884 | 334 | received_im_msg_cb(PurpleAccount *account, char *sender, char *buffer, |
| 335 | PurpleConversation *conv, PurpleMessageFlags flags, void *data) | |
| 8999 | 336 | { |
| 15884 | 337 | purple_debug_misc("signals test", "received-im-msg (%s, %s, %s, %s, %d)\n", |
| 338 | purple_account_get_username(account), sender, buffer, | |
| 339 | (conv != NULL) ? purple_conversation_get_name(conv) : "(null)", flags); | |
| 8999 | 340 | } |
| 341 | ||
| 6485 | 342 | static gboolean |
| 15884 | 343 | writing_chat_msg_cb(PurpleAccount *account, const char *who, char **buffer, |
| 344 | PurpleConversation *conv, PurpleMessageFlags flags, void *data) | |
| 9051 | 345 | { |
| 15884 | 346 | purple_debug_misc("signals test", "writing-chat-msg (%s, %s)\n", |
| 347 | purple_conversation_get_name(conv), *buffer); | |
| 9051 | 348 | |
| 349 | return FALSE; | |
| 350 | } | |
| 351 | ||
| 352 | static void | |
|
36108
69b4fce85ffa
Switch _purple_conversation_write_common and (writing|wrote)-(chat|im)-msg to PurpleMessage
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
36098
diff
changeset
|
353 | wrote_chat_msg_cb(PurpleConversation *conv, PurpleMessage *msg, gpointer data) |
| 9051 | 354 | { |
| 15884 | 355 | purple_debug_misc("signals test", "wrote-chat-msg (%s, %s)\n", |
|
36108
69b4fce85ffa
Switch _purple_conversation_write_common and (writing|wrote)-(chat|im)-msg to PurpleMessage
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
36098
diff
changeset
|
356 | purple_conversation_get_name(conv), |
|
69b4fce85ffa
Switch _purple_conversation_write_common and (writing|wrote)-(chat|im)-msg to PurpleMessage
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
36098
diff
changeset
|
357 | purple_message_get_contents(msg)); |
| 9051 | 358 | } |
| 359 | ||
| 360 | static gboolean | |
|
36080
637a1a87c4d3
Switch sending-chat-msg to PurpleMessage
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
36079
diff
changeset
|
361 | sending_chat_msg_cb(PurpleAccount *account, PurpleMessage *msg, int id, void *data) |
| 6485 | 362 | { |
| 15884 | 363 | purple_debug_misc("signals test", "sending-chat-msg (%s, %s, %d)\n", |
|
36080
637a1a87c4d3
Switch sending-chat-msg to PurpleMessage
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
36079
diff
changeset
|
364 | purple_account_get_username(account), |
|
637a1a87c4d3
Switch sending-chat-msg to PurpleMessage
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
36079
diff
changeset
|
365 | purple_message_get_contents(msg), id); |
| 6485 | 366 | |
| 367 | return FALSE; | |
| 368 | } | |
| 369 | ||
| 370 | static void | |
|
36082
247d94c903c3
Switch sent-chat-msg to PurpleMessage
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
36081
diff
changeset
|
371 | sent_chat_msg_cb(PurpleAccount *account, PurpleMessage *msg, int id, void *data) |
| 6485 | 372 | { |
| 15884 | 373 | purple_debug_misc("signals test", "sent-chat-msg (%s, %s, %d)\n", |
|
36082
247d94c903c3
Switch sent-chat-msg to PurpleMessage
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
36081
diff
changeset
|
374 | purple_account_get_username(account), |
|
247d94c903c3
Switch sent-chat-msg to PurpleMessage
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
36081
diff
changeset
|
375 | purple_message_get_contents(msg), id); |
| 6485 | 376 | } |
| 377 | ||
| 378 | static gboolean | |
| 15884 | 379 | receiving_chat_msg_cb(PurpleAccount *account, char **sender, char **buffer, |
| 380 | PurpleConversation *chat, PurpleMessageFlags *flags, void *data) | |
| 6485 | 381 | { |
| 15884 | 382 | purple_debug_misc("signals test", |
|
10104
081392879815
[gaim-migrate @ 11131]
Nathan Fredrickson <nathan@silverorange.com>
parents:
9954
diff
changeset
|
383 | "receiving-chat-msg (%s, %s, %s, %s, %d)\n", |
| 15884 | 384 | purple_account_get_username(account), *sender, *buffer, |
| 385 | purple_conversation_get_name(chat), *flags); | |
| 6485 | 386 | |
| 387 | return FALSE; | |
| 388 | } | |
| 389 | ||
| 390 | static void | |
| 15884 | 391 | received_chat_msg_cb(PurpleAccount *account, char *sender, char *buffer, |
| 392 | PurpleConversation *chat, PurpleMessageFlags flags, void *data) | |
| 8999 | 393 | { |
| 15884 | 394 | purple_debug_misc("signals test", |
|
10104
081392879815
[gaim-migrate @ 11131]
Nathan Fredrickson <nathan@silverorange.com>
parents:
9954
diff
changeset
|
395 | "received-chat-msg (%s, %s, %s, %s, %d)\n", |
| 15884 | 396 | purple_account_get_username(account), sender, buffer, |
| 397 | purple_conversation_get_name(chat), flags); | |
| 8999 | 398 | } |
| 399 | ||
| 400 | static void | |
| 15884 | 401 | conversation_created_cb(PurpleConversation *conv, void *data) |
| 6485 | 402 | { |
| 15884 | 403 | purple_debug_misc("signals test", "conversation-created (%s)\n", |
| 404 | purple_conversation_get_name(conv)); | |
| 6485 | 405 | } |
| 406 | ||
| 407 | static void | |
| 15884 | 408 | deleting_conversation_cb(PurpleConversation *conv, void *data) |
| 6485 | 409 | { |
| 15884 | 410 | purple_debug_misc("signals test", "deleting-conversation (%s)\n", |
| 411 | purple_conversation_get_name(conv)); | |
| 6485 | 412 | } |
| 413 | ||
| 414 | static void | |
| 15884 | 415 | buddy_typing_cb(PurpleAccount *account, const char *name, void *data) |
| 6485 | 416 | { |
| 15884 | 417 | purple_debug_misc("signals test", "buddy-typing (%s, %s)\n", |
| 418 | purple_account_get_username(account), name); | |
|
11706
e45dd5c7b259
[gaim-migrate @ 13997]
Richard Laager <rlaager@pidgin.im>
parents:
11628
diff
changeset
|
419 | } |
|
e45dd5c7b259
[gaim-migrate @ 13997]
Richard Laager <rlaager@pidgin.im>
parents:
11628
diff
changeset
|
420 | |
|
e45dd5c7b259
[gaim-migrate @ 13997]
Richard Laager <rlaager@pidgin.im>
parents:
11628
diff
changeset
|
421 | static void |
| 15884 | 422 | buddy_typing_stopped_cb(PurpleAccount *account, const char *name, void *data) |
|
11706
e45dd5c7b259
[gaim-migrate @ 13997]
Richard Laager <rlaager@pidgin.im>
parents:
11628
diff
changeset
|
423 | { |
| 15884 | 424 | purple_debug_misc("signals test", "buddy-typing-stopped (%s, %s)\n", |
| 425 | purple_account_get_username(account), name); | |
| 6485 | 426 | } |
| 427 | ||
| 9587 | 428 | static gboolean |
|
34670
9bd5bd903dc7
Renamed chat buddies to chat users, and IM conversation typing state to IM typing state.
Ankit Vani <a@nevitus.org>
parents:
34669
diff
changeset
|
429 | chat_user_joining_cb(PurpleConversation *conv, const char *user, |
|
9bd5bd903dc7
Renamed chat buddies to chat users, and IM conversation typing state to IM typing state.
Ankit Vani <a@nevitus.org>
parents:
34669
diff
changeset
|
430 | PurpleChatUserFlags flags, void *data) |
| 6485 | 431 | { |
|
34670
9bd5bd903dc7
Renamed chat buddies to chat users, and IM conversation typing state to IM typing state.
Ankit Vani <a@nevitus.org>
parents:
34669
diff
changeset
|
432 | purple_debug_misc("signals test", "chat-user-joining (%s, %s, %d)\n", |
| 15884 | 433 | purple_conversation_get_name(conv), user, flags); |
| 9587 | 434 | |
| 435 | return FALSE; | |
| 6485 | 436 | } |
| 437 | ||
| 438 | static void | |
|
34670
9bd5bd903dc7
Renamed chat buddies to chat users, and IM conversation typing state to IM typing state.
Ankit Vani <a@nevitus.org>
parents:
34669
diff
changeset
|
439 | chat_user_joined_cb(PurpleConversation *conv, const char *user, |
|
9bd5bd903dc7
Renamed chat buddies to chat users, and IM conversation typing state to IM typing state.
Ankit Vani <a@nevitus.org>
parents:
34669
diff
changeset
|
440 | PurpleChatUserFlags flags, gboolean new_arrival, void *data) |
| 6485 | 441 | { |
|
34670
9bd5bd903dc7
Renamed chat buddies to chat users, and IM conversation typing state to IM typing state.
Ankit Vani <a@nevitus.org>
parents:
34669
diff
changeset
|
442 | purple_debug_misc("signals test", "chat-user-joined (%s, %s, %d, %d)\n", |
| 15884 | 443 | purple_conversation_get_name(conv), user, flags, new_arrival); |
|
9554
1609ba3612c3
[gaim-migrate @ 10387]
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
9517
diff
changeset
|
444 | } |
|
1609ba3612c3
[gaim-migrate @ 10387]
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
9517
diff
changeset
|
445 | |
|
1609ba3612c3
[gaim-migrate @ 10387]
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
9517
diff
changeset
|
446 | static void |
|
34670
9bd5bd903dc7
Renamed chat buddies to chat users, and IM conversation typing state to IM typing state.
Ankit Vani <a@nevitus.org>
parents:
34669
diff
changeset
|
447 | chat_user_flags_cb(PurpleChatUser *cb, PurpleChatUserFlags oldflags, |
|
9bd5bd903dc7
Renamed chat buddies to chat users, and IM conversation typing state to IM typing state.
Ankit Vani <a@nevitus.org>
parents:
34669
diff
changeset
|
448 | PurpleChatUserFlags newflags, void *data) |
|
9554
1609ba3612c3
[gaim-migrate @ 10387]
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
9517
diff
changeset
|
449 | { |
|
34670
9bd5bd903dc7
Renamed chat buddies to chat users, and IM conversation typing state to IM typing state.
Ankit Vani <a@nevitus.org>
parents:
34669
diff
changeset
|
450 | purple_debug_misc("signals test", "chat-user-flags (%s, %s, %d, %d)\n", |
|
34669
250f77369396
Replaced chatname, buddyname arguments of "chat-buddy-flags" signal with PurpleChatConversationBuddy *
Ankit Vani <a@nevitus.org>
parents:
34622
diff
changeset
|
451 | purple_conversation_get_name(PURPLE_CONVERSATION( |
|
34670
9bd5bd903dc7
Renamed chat buddies to chat users, and IM conversation typing state to IM typing state.
Ankit Vani <a@nevitus.org>
parents:
34669
diff
changeset
|
452 | purple_chat_user_get_chat(cb))), |
|
9bd5bd903dc7
Renamed chat buddies to chat users, and IM conversation typing state to IM typing state.
Ankit Vani <a@nevitus.org>
parents:
34669
diff
changeset
|
453 | purple_chat_user_get_name(cb), oldflags, newflags); |
| 6485 | 454 | } |
| 455 | ||
| 9587 | 456 | static gboolean |
|
34670
9bd5bd903dc7
Renamed chat buddies to chat users, and IM conversation typing state to IM typing state.
Ankit Vani <a@nevitus.org>
parents:
34669
diff
changeset
|
457 | chat_user_leaving_cb(PurpleConversation *conv, const char *user, |
| 6485 | 458 | const char *reason, void *data) |
| 459 | { | |
|
34670
9bd5bd903dc7
Renamed chat buddies to chat users, and IM conversation typing state to IM typing state.
Ankit Vani <a@nevitus.org>
parents:
34669
diff
changeset
|
460 | purple_debug_misc("signals test", "chat-user-leaving (%s, %s, %s)\n", |
| 15884 | 461 | purple_conversation_get_name(conv), user, reason); |
| 9587 | 462 | |
| 463 | return FALSE; | |
| 6485 | 464 | } |
| 465 | ||
| 466 | static void | |
|
34670
9bd5bd903dc7
Renamed chat buddies to chat users, and IM conversation typing state to IM typing state.
Ankit Vani <a@nevitus.org>
parents:
34669
diff
changeset
|
467 | chat_user_left_cb(PurpleConversation *conv, const char *user, |
| 6485 | 468 | const char *reason, void *data) |
| 469 | { | |
|
34670
9bd5bd903dc7
Renamed chat buddies to chat users, and IM conversation typing state to IM typing state.
Ankit Vani <a@nevitus.org>
parents:
34669
diff
changeset
|
470 | purple_debug_misc("signals test", "chat-user-left (%s, %s, %s)\n", |
| 15884 | 471 | purple_conversation_get_name(conv), user, reason); |
| 6485 | 472 | } |
| 473 | ||
| 474 | static void | |
| 15884 | 475 | chat_inviting_user_cb(PurpleConversation *conv, const char *name, |
|
9554
1609ba3612c3
[gaim-migrate @ 10387]
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
9517
diff
changeset
|
476 | char **reason, void *data) |
| 6485 | 477 | { |
| 15884 | 478 | purple_debug_misc("signals test", "chat-inviting-user (%s, %s, %s)\n", |
| 479 | purple_conversation_get_name(conv), name, *reason); | |
| 6485 | 480 | } |
| 481 | ||
| 482 | static void | |
| 15884 | 483 | chat_invited_user_cb(PurpleConversation *conv, const char *name, |
| 6485 | 484 | const char *reason, void *data) |
| 485 | { | |
| 15884 | 486 | purple_debug_misc("signals test", "chat-invited-user (%s, %s, %s)\n", |
| 487 | purple_conversation_get_name(conv), name, reason); | |
| 6485 | 488 | } |
| 489 | ||
| 11064 | 490 | static gint |
| 15884 | 491 | chat_invited_cb(PurpleAccount *account, const char *inviter, |
| 9514 | 492 | const char *room_name, const char *message, |
| 493 | const GHashTable *components, void *data) | |
| 6485 | 494 | { |
| 15884 | 495 | purple_debug_misc("signals test", "chat-invited (%s, %s, %s, %s)\n", |
| 496 | purple_account_get_username(account), inviter, | |
|
7517
cda1bf7428a7
[gaim-migrate @ 8130]
Christian Hammond <chipx86@chipx86.com>
parents:
7516
diff
changeset
|
497 | room_name, message); |
| 11064 | 498 | |
| 499 | return 0; | |
| 6485 | 500 | } |
| 501 | ||
| 502 | static void | |
| 15884 | 503 | chat_joined_cb(PurpleConversation *conv, void *data) |
| 6485 | 504 | { |
| 15884 | 505 | purple_debug_misc("signals test", "chat-joined (%s)\n", |
| 506 | purple_conversation_get_name(conv)); | |
| 6485 | 507 | } |
| 508 | ||
| 509 | static void | |
| 15884 | 510 | chat_left_cb(PurpleConversation *conv, void *data) |
| 6485 | 511 | { |
| 15884 | 512 | purple_debug_misc("signals test", "chat-left (%s)\n", |
| 513 | purple_conversation_get_name(conv)); | |
| 6485 | 514 | } |
| 515 | ||
| 9517 | 516 | static void |
| 15884 | 517 | chat_topic_changed_cb(PurpleConversation *conv, const char *who, |
| 9517 | 518 | const char *topic, void *data) |
| 519 | { | |
| 15884 | 520 | purple_debug_misc("signals test", |
| 9517 | 521 | "chat-topic-changed (%s topic changed to: \"%s\" by %s)\n", |
| 15884 | 522 | purple_conversation_get_name(conv), topic, |
| 9517 | 523 | (who) ? who : "unknown"); |
| 524 | } | |
| 6485 | 525 | /************************************************************************** |
| 526 | * Core signal callbacks | |
| 527 | **************************************************************************/ | |
| 528 | static void | |
| 529 | quitting_cb(void *data) | |
| 530 | { | |
| 15884 | 531 | purple_debug_misc("signals test", "quitting ()\n"); |
| 6485 | 532 | } |
| 533 | ||
|
29189
141cdbeab2a5
Add support for the uri-handler signal to the signals-test plugin
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
28981
diff
changeset
|
534 | static void |
|
141cdbeab2a5
Add support for the uri-handler signal to the signals-test plugin
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
28981
diff
changeset
|
535 | printhash(gpointer key, gpointer value, gpointer data) |
|
141cdbeab2a5
Add support for the uri-handler signal to the signals-test plugin
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
28981
diff
changeset
|
536 | { |
|
141cdbeab2a5
Add support for the uri-handler signal to the signals-test plugin
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
28981
diff
changeset
|
537 | char *a = (char *)key; |
|
141cdbeab2a5
Add support for the uri-handler signal to the signals-test plugin
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
28981
diff
changeset
|
538 | char *b = (char *)value; |
|
141cdbeab2a5
Add support for the uri-handler signal to the signals-test plugin
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
28981
diff
changeset
|
539 | GString *str = (GString *)data; |
|
141cdbeab2a5
Add support for the uri-handler signal to the signals-test plugin
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
28981
diff
changeset
|
540 | g_string_append_printf(str, " [%s] = [%s]\n", a, b ? b : "(null)"); |
|
141cdbeab2a5
Add support for the uri-handler signal to the signals-test plugin
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
28981
diff
changeset
|
541 | } |
|
141cdbeab2a5
Add support for the uri-handler signal to the signals-test plugin
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
28981
diff
changeset
|
542 | |
|
141cdbeab2a5
Add support for the uri-handler signal to the signals-test plugin
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
28981
diff
changeset
|
543 | static gboolean |
|
141cdbeab2a5
Add support for the uri-handler signal to the signals-test plugin
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
28981
diff
changeset
|
544 | uri_handler(const char *proto, const char *cmd, GHashTable *params) |
|
141cdbeab2a5
Add support for the uri-handler signal to the signals-test plugin
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
28981
diff
changeset
|
545 | { |
|
141cdbeab2a5
Add support for the uri-handler signal to the signals-test plugin
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
28981
diff
changeset
|
546 | GString *str = g_string_new("\n{\n"); |
|
141cdbeab2a5
Add support for the uri-handler signal to the signals-test plugin
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
28981
diff
changeset
|
547 | g_hash_table_foreach(params, printhash, str); |
|
141cdbeab2a5
Add support for the uri-handler signal to the signals-test plugin
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
28981
diff
changeset
|
548 | g_string_append_c(str, '}'); |
|
141cdbeab2a5
Add support for the uri-handler signal to the signals-test plugin
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
28981
diff
changeset
|
549 | purple_debug_misc("signals test", "uri handler (%s, %s, %s)\n", proto, cmd, str->str); |
|
141cdbeab2a5
Add support for the uri-handler signal to the signals-test plugin
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
28981
diff
changeset
|
550 | g_string_free(str, TRUE); |
|
141cdbeab2a5
Add support for the uri-handler signal to the signals-test plugin
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
28981
diff
changeset
|
551 | return FALSE; |
|
141cdbeab2a5
Add support for the uri-handler signal to the signals-test plugin
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
28981
diff
changeset
|
552 | } |
|
141cdbeab2a5
Add support for the uri-handler signal to the signals-test plugin
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
28981
diff
changeset
|
553 | |
| 6485 | 554 | /************************************************************************** |
|
11281
a5cda37a16be
[gaim-migrate @ 13478]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
11256
diff
changeset
|
555 | * File transfer signal callbacks |
|
a5cda37a16be
[gaim-migrate @ 13478]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
11256
diff
changeset
|
556 | **************************************************************************/ |
|
a5cda37a16be
[gaim-migrate @ 13478]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
11256
diff
changeset
|
557 | static void |
| 15884 | 558 | ft_recv_accept_cb(PurpleXfer *xfer, gpointer data) { |
| 559 | purple_debug_misc("signals test", "file receive accepted\n"); | |
|
11281
a5cda37a16be
[gaim-migrate @ 13478]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
11256
diff
changeset
|
560 | } |
|
a5cda37a16be
[gaim-migrate @ 13478]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
11256
diff
changeset
|
561 | |
|
a5cda37a16be
[gaim-migrate @ 13478]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
11256
diff
changeset
|
562 | static void |
| 15884 | 563 | ft_send_accept_cb(PurpleXfer *xfer, gpointer data) { |
| 564 | purple_debug_misc("signals test", "file send accepted\n"); | |
|
11281
a5cda37a16be
[gaim-migrate @ 13478]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
11256
diff
changeset
|
565 | } |
|
a5cda37a16be
[gaim-migrate @ 13478]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
11256
diff
changeset
|
566 | |
|
a5cda37a16be
[gaim-migrate @ 13478]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
11256
diff
changeset
|
567 | static void |
| 15884 | 568 | ft_recv_start_cb(PurpleXfer *xfer, gpointer data) { |
| 569 | purple_debug_misc("signals test", "file receive started\n"); | |
|
11281
a5cda37a16be
[gaim-migrate @ 13478]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
11256
diff
changeset
|
570 | } |
|
a5cda37a16be
[gaim-migrate @ 13478]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
11256
diff
changeset
|
571 | |
|
a5cda37a16be
[gaim-migrate @ 13478]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
11256
diff
changeset
|
572 | static void |
| 15884 | 573 | ft_send_start_cb(PurpleXfer *xfer, gpointer data) { |
| 574 | purple_debug_misc("signals test", "file send started\n"); | |
|
11281
a5cda37a16be
[gaim-migrate @ 13478]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
11256
diff
changeset
|
575 | } |
|
a5cda37a16be
[gaim-migrate @ 13478]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
11256
diff
changeset
|
576 | |
|
a5cda37a16be
[gaim-migrate @ 13478]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
11256
diff
changeset
|
577 | static void |
| 15884 | 578 | ft_recv_cancel_cb(PurpleXfer *xfer, gpointer data) { |
|
30708
535bec1e66fb
Standardize on "cancelled".
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
29189
diff
changeset
|
579 | purple_debug_misc("signals test", "file receive cancelled\n"); |
|
11281
a5cda37a16be
[gaim-migrate @ 13478]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
11256
diff
changeset
|
580 | } |
|
a5cda37a16be
[gaim-migrate @ 13478]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
11256
diff
changeset
|
581 | |
|
a5cda37a16be
[gaim-migrate @ 13478]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
11256
diff
changeset
|
582 | static void |
| 15884 | 583 | ft_send_cancel_cb(PurpleXfer *xfer, gpointer data) { |
|
30708
535bec1e66fb
Standardize on "cancelled".
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
29189
diff
changeset
|
584 | purple_debug_misc("signals test", "file send cancelled\n"); |
|
11281
a5cda37a16be
[gaim-migrate @ 13478]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
11256
diff
changeset
|
585 | } |
|
a5cda37a16be
[gaim-migrate @ 13478]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
11256
diff
changeset
|
586 | |
|
a5cda37a16be
[gaim-migrate @ 13478]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
11256
diff
changeset
|
587 | static void |
| 15884 | 588 | ft_recv_complete_cb(PurpleXfer *xfer, gpointer data) { |
| 589 | purple_debug_misc("signals test", "file receive completed\n"); | |
|
11281
a5cda37a16be
[gaim-migrate @ 13478]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
11256
diff
changeset
|
590 | } |
|
a5cda37a16be
[gaim-migrate @ 13478]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
11256
diff
changeset
|
591 | |
|
a5cda37a16be
[gaim-migrate @ 13478]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
11256
diff
changeset
|
592 | static void |
| 15884 | 593 | ft_send_complete_cb(PurpleXfer *xfer, gpointer data) { |
| 594 | purple_debug_misc("signals test", "file send completed\n"); | |
|
11281
a5cda37a16be
[gaim-migrate @ 13478]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
11256
diff
changeset
|
595 | } |
|
a5cda37a16be
[gaim-migrate @ 13478]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
11256
diff
changeset
|
596 | |
|
a5cda37a16be
[gaim-migrate @ 13478]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
11256
diff
changeset
|
597 | /************************************************************************** |
| 12291 | 598 | * Sound signal callbacks |
| 599 | **************************************************************************/ | |
| 600 | static int | |
| 15884 | 601 | sound_playing_event_cb(PurpleSoundEventID event, const PurpleAccount *account) { |
|
12850
744542bdd53e
[gaim-migrate @ 15200]
Casey Harkins <charkins@pidgin.im>
parents:
12639
diff
changeset
|
602 | if (account != NULL) |
| 15884 | 603 | purple_debug_misc("signals test", "sound playing event: %d for account: %s\n", |
| 604 | event, purple_account_get_username(account)); | |
|
12850
744542bdd53e
[gaim-migrate @ 15200]
Casey Harkins <charkins@pidgin.im>
parents:
12639
diff
changeset
|
605 | else |
| 15884 | 606 | purple_debug_misc("signals test", "sound playing event: %d\n", event); |
| 12291 | 607 | |
| 608 | return 0; | |
| 609 | } | |
| 610 | ||
| 611 | /************************************************************************** | |
|
18976
fcf071533791
Email notification signals from charkins. Fixes #1324
Sean Egan <seanegan@pidgin.im>
parents:
16786
diff
changeset
|
612 | * Notify signals callbacks |
|
fcf071533791
Email notification signals from charkins. Fixes #1324
Sean Egan <seanegan@pidgin.im>
parents:
16786
diff
changeset
|
613 | **************************************************************************/ |
|
fcf071533791
Email notification signals from charkins. Fixes #1324
Sean Egan <seanegan@pidgin.im>
parents:
16786
diff
changeset
|
614 | static void |
|
fcf071533791
Email notification signals from charkins. Fixes #1324
Sean Egan <seanegan@pidgin.im>
parents:
16786
diff
changeset
|
615 | notify_email_cb(char *subject, char *from, char *to, char *url) { |
|
fcf071533791
Email notification signals from charkins. Fixes #1324
Sean Egan <seanegan@pidgin.im>
parents:
16786
diff
changeset
|
616 | purple_debug_misc("signals test", "notify email: subject=%s, from=%s, to=%s, url=%s\n", |
|
fcf071533791
Email notification signals from charkins. Fixes #1324
Sean Egan <seanegan@pidgin.im>
parents:
16786
diff
changeset
|
617 | subject, from, to, url); |
|
fcf071533791
Email notification signals from charkins. Fixes #1324
Sean Egan <seanegan@pidgin.im>
parents:
16786
diff
changeset
|
618 | } |
|
fcf071533791
Email notification signals from charkins. Fixes #1324
Sean Egan <seanegan@pidgin.im>
parents:
16786
diff
changeset
|
619 | |
|
fcf071533791
Email notification signals from charkins. Fixes #1324
Sean Egan <seanegan@pidgin.im>
parents:
16786
diff
changeset
|
620 | static void |
|
fcf071533791
Email notification signals from charkins. Fixes #1324
Sean Egan <seanegan@pidgin.im>
parents:
16786
diff
changeset
|
621 | notify_emails_cb(char **subjects, char **froms, char **tos, char **urls, guint count) { |
|
36256
a437550a9308
Remove -Wno-sign-compare and backport fixes from default.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
30708
diff
changeset
|
622 | guint i; |
|
a437550a9308
Remove -Wno-sign-compare and backport fixes from default.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
30708
diff
changeset
|
623 | purple_debug_misc("signals test", "notify emails: count=%u\n", count); |
|
18976
fcf071533791
Email notification signals from charkins. Fixes #1324
Sean Egan <seanegan@pidgin.im>
parents:
16786
diff
changeset
|
624 | for(i=0; i<count && i<5; i++) { |
|
fcf071533791
Email notification signals from charkins. Fixes #1324
Sean Egan <seanegan@pidgin.im>
parents:
16786
diff
changeset
|
625 | if(subjects[i]==NULL || froms[i]==NULL || tos[i]==NULL || urls[i]==NULL) continue; |
|
36256
a437550a9308
Remove -Wno-sign-compare and backport fixes from default.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
30708
diff
changeset
|
626 | purple_debug_misc("signals test", "notify emails[%u]: subject=%s, from=%s, to=%s, url=%s\n", |
|
18976
fcf071533791
Email notification signals from charkins. Fixes #1324
Sean Egan <seanegan@pidgin.im>
parents:
16786
diff
changeset
|
627 | i, subjects[i], froms[i], tos[i], urls[i]); |
|
fcf071533791
Email notification signals from charkins. Fixes #1324
Sean Egan <seanegan@pidgin.im>
parents:
16786
diff
changeset
|
628 | } |
|
fcf071533791
Email notification signals from charkins. Fixes #1324
Sean Egan <seanegan@pidgin.im>
parents:
16786
diff
changeset
|
629 | } |
|
fcf071533791
Email notification signals from charkins. Fixes #1324
Sean Egan <seanegan@pidgin.im>
parents:
16786
diff
changeset
|
630 | |
|
fcf071533791
Email notification signals from charkins. Fixes #1324
Sean Egan <seanegan@pidgin.im>
parents:
16786
diff
changeset
|
631 | /************************************************************************** |
|
27159
4629464a3430
Add the XMPP signals to the signals-test plugin
Paul Aurich <darkrain42@pidgin.im>
parents:
27023
diff
changeset
|
632 | * Jabber signals callbacks |
|
4629464a3430
Add the XMPP signals to the signals-test plugin
Paul Aurich <darkrain42@pidgin.im>
parents:
27023
diff
changeset
|
633 | **************************************************************************/ |
|
4629464a3430
Add the XMPP signals to the signals-test plugin
Paul Aurich <darkrain42@pidgin.im>
parents:
27023
diff
changeset
|
634 | static gboolean |
|
4629464a3430
Add the XMPP signals to the signals-test plugin
Paul Aurich <darkrain42@pidgin.im>
parents:
27023
diff
changeset
|
635 | jabber_iq_received(PurpleConnection *pc, const char *type, const char *id, |
|
34935
686fa55b0deb
Replaced xmlnode with PurpleXmlNode, and xmlnode_* API with purple_xmlnode_* API
Ankit Vani <a@nevitus.org>
parents:
34910
diff
changeset
|
636 | const char *from, PurpleXmlNode *iq) |
|
27159
4629464a3430
Add the XMPP signals to the signals-test plugin
Paul Aurich <darkrain42@pidgin.im>
parents:
27023
diff
changeset
|
637 | { |
|
27160
1d64b0240519
Add 'jabber' to the signals output and NULL checking so it won't crash on Windows
Paul Aurich <darkrain42@pidgin.im>
parents:
27159
diff
changeset
|
638 | purple_debug_misc("signals test", "jabber IQ (type=%s, id=%s, from=%s) %p\n", |
|
1d64b0240519
Add 'jabber' to the signals output and NULL checking so it won't crash on Windows
Paul Aurich <darkrain42@pidgin.im>
parents:
27159
diff
changeset
|
639 | type, id, from ? from : "(null)", iq); |
|
27159
4629464a3430
Add the XMPP signals to the signals-test plugin
Paul Aurich <darkrain42@pidgin.im>
parents:
27023
diff
changeset
|
640 | |
|
4629464a3430
Add the XMPP signals to the signals-test plugin
Paul Aurich <darkrain42@pidgin.im>
parents:
27023
diff
changeset
|
641 | /* We don't want the plugin to stop processing */ |
|
4629464a3430
Add the XMPP signals to the signals-test plugin
Paul Aurich <darkrain42@pidgin.im>
parents:
27023
diff
changeset
|
642 | return FALSE; |
|
4629464a3430
Add the XMPP signals to the signals-test plugin
Paul Aurich <darkrain42@pidgin.im>
parents:
27023
diff
changeset
|
643 | } |
|
4629464a3430
Add the XMPP signals to the signals-test plugin
Paul Aurich <darkrain42@pidgin.im>
parents:
27023
diff
changeset
|
644 | |
|
4629464a3430
Add the XMPP signals to the signals-test plugin
Paul Aurich <darkrain42@pidgin.im>
parents:
27023
diff
changeset
|
645 | static gboolean |
|
4629464a3430
Add the XMPP signals to the signals-test plugin
Paul Aurich <darkrain42@pidgin.im>
parents:
27023
diff
changeset
|
646 | jabber_message_received(PurpleConnection *pc, const char *type, const char *id, |
|
34935
686fa55b0deb
Replaced xmlnode with PurpleXmlNode, and xmlnode_* API with purple_xmlnode_* API
Ankit Vani <a@nevitus.org>
parents:
34910
diff
changeset
|
647 | const char *from, const char *to, PurpleXmlNode *message) |
|
27159
4629464a3430
Add the XMPP signals to the signals-test plugin
Paul Aurich <darkrain42@pidgin.im>
parents:
27023
diff
changeset
|
648 | { |
|
27160
1d64b0240519
Add 'jabber' to the signals output and NULL checking so it won't crash on Windows
Paul Aurich <darkrain42@pidgin.im>
parents:
27159
diff
changeset
|
649 | purple_debug_misc("signals test", "jabber message (type=%s, id=%s, " |
|
27159
4629464a3430
Add the XMPP signals to the signals-test plugin
Paul Aurich <darkrain42@pidgin.im>
parents:
27023
diff
changeset
|
650 | "from=%s to=%s) %p\n", |
|
27160
1d64b0240519
Add 'jabber' to the signals output and NULL checking so it won't crash on Windows
Paul Aurich <darkrain42@pidgin.im>
parents:
27159
diff
changeset
|
651 | type ? type : "(null)", id ? id : "(null)", |
|
1d64b0240519
Add 'jabber' to the signals output and NULL checking so it won't crash on Windows
Paul Aurich <darkrain42@pidgin.im>
parents:
27159
diff
changeset
|
652 | from ? from : "(null)", to ? to : "(null)", message); |
|
27159
4629464a3430
Add the XMPP signals to the signals-test plugin
Paul Aurich <darkrain42@pidgin.im>
parents:
27023
diff
changeset
|
653 | |
|
4629464a3430
Add the XMPP signals to the signals-test plugin
Paul Aurich <darkrain42@pidgin.im>
parents:
27023
diff
changeset
|
654 | /* We don't want the plugin to stop processing */ |
|
4629464a3430
Add the XMPP signals to the signals-test plugin
Paul Aurich <darkrain42@pidgin.im>
parents:
27023
diff
changeset
|
655 | return FALSE; |
|
4629464a3430
Add the XMPP signals to the signals-test plugin
Paul Aurich <darkrain42@pidgin.im>
parents:
27023
diff
changeset
|
656 | } |
|
4629464a3430
Add the XMPP signals to the signals-test plugin
Paul Aurich <darkrain42@pidgin.im>
parents:
27023
diff
changeset
|
657 | |
|
4629464a3430
Add the XMPP signals to the signals-test plugin
Paul Aurich <darkrain42@pidgin.im>
parents:
27023
diff
changeset
|
658 | static gboolean |
|
4629464a3430
Add the XMPP signals to the signals-test plugin
Paul Aurich <darkrain42@pidgin.im>
parents:
27023
diff
changeset
|
659 | jabber_presence_received(PurpleConnection *pc, const char *type, |
|
34935
686fa55b0deb
Replaced xmlnode with PurpleXmlNode, and xmlnode_* API with purple_xmlnode_* API
Ankit Vani <a@nevitus.org>
parents:
34910
diff
changeset
|
660 | const char *from, PurpleXmlNode *presence) |
|
27159
4629464a3430
Add the XMPP signals to the signals-test plugin
Paul Aurich <darkrain42@pidgin.im>
parents:
27023
diff
changeset
|
661 | { |
|
27160
1d64b0240519
Add 'jabber' to the signals output and NULL checking so it won't crash on Windows
Paul Aurich <darkrain42@pidgin.im>
parents:
27159
diff
changeset
|
662 | purple_debug_misc("signals test", "jabber presence (type=%s, from=%s) %p\n", |
|
1d64b0240519
Add 'jabber' to the signals output and NULL checking so it won't crash on Windows
Paul Aurich <darkrain42@pidgin.im>
parents:
27159
diff
changeset
|
663 | type ? type : "(null)", from ? from : "(null)", presence); |
|
27159
4629464a3430
Add the XMPP signals to the signals-test plugin
Paul Aurich <darkrain42@pidgin.im>
parents:
27023
diff
changeset
|
664 | |
|
4629464a3430
Add the XMPP signals to the signals-test plugin
Paul Aurich <darkrain42@pidgin.im>
parents:
27023
diff
changeset
|
665 | /* We don't want the plugin to stop processing */ |
|
4629464a3430
Add the XMPP signals to the signals-test plugin
Paul Aurich <darkrain42@pidgin.im>
parents:
27023
diff
changeset
|
666 | return FALSE; |
|
4629464a3430
Add the XMPP signals to the signals-test plugin
Paul Aurich <darkrain42@pidgin.im>
parents:
27023
diff
changeset
|
667 | } |
|
4629464a3430
Add the XMPP signals to the signals-test plugin
Paul Aurich <darkrain42@pidgin.im>
parents:
27023
diff
changeset
|
668 | |
|
27223
d41e83f82148
Examples for the namespace-(un)registering of IQs and added IPC versions
Paul Aurich <darkrain42@pidgin.im>
parents:
27160
diff
changeset
|
669 | static gboolean |
|
d41e83f82148
Examples for the namespace-(un)registering of IQs and added IPC versions
Paul Aurich <darkrain42@pidgin.im>
parents:
27160
diff
changeset
|
670 | jabber_watched_iq(PurpleConnection *pc, const char *type, const char *id, |
|
34935
686fa55b0deb
Replaced xmlnode with PurpleXmlNode, and xmlnode_* API with purple_xmlnode_* API
Ankit Vani <a@nevitus.org>
parents:
34910
diff
changeset
|
671 | const char *from, PurpleXmlNode *child) |
|
27223
d41e83f82148
Examples for the namespace-(un)registering of IQs and added IPC versions
Paul Aurich <darkrain42@pidgin.im>
parents:
27160
diff
changeset
|
672 | { |
|
d41e83f82148
Examples for the namespace-(un)registering of IQs and added IPC versions
Paul Aurich <darkrain42@pidgin.im>
parents:
27160
diff
changeset
|
673 | purple_debug_misc("signals test", "jabber watched IQ (type=%s, id=%s, from=%s)\n" |
|
d41e83f82148
Examples for the namespace-(un)registering of IQs and added IPC versions
Paul Aurich <darkrain42@pidgin.im>
parents:
27160
diff
changeset
|
674 | "child %p name=%s, namespace=%s\n", |
|
d41e83f82148
Examples for the namespace-(un)registering of IQs and added IPC versions
Paul Aurich <darkrain42@pidgin.im>
parents:
27160
diff
changeset
|
675 | type, id, from, child, child->name, |
|
34935
686fa55b0deb
Replaced xmlnode with PurpleXmlNode, and xmlnode_* API with purple_xmlnode_* API
Ankit Vani <a@nevitus.org>
parents:
34910
diff
changeset
|
676 | purple_xmlnode_get_namespace(child)); |
|
27223
d41e83f82148
Examples for the namespace-(un)registering of IQs and added IPC versions
Paul Aurich <darkrain42@pidgin.im>
parents:
27160
diff
changeset
|
677 | |
|
d41e83f82148
Examples for the namespace-(un)registering of IQs and added IPC versions
Paul Aurich <darkrain42@pidgin.im>
parents:
27160
diff
changeset
|
678 | if (g_str_equal(type, "get") || g_str_equal(type, "set")) { |
|
d41e83f82148
Examples for the namespace-(un)registering of IQs and added IPC versions
Paul Aurich <darkrain42@pidgin.im>
parents:
27160
diff
changeset
|
679 | /* Send the requisite reply */ |
|
34935
686fa55b0deb
Replaced xmlnode with PurpleXmlNode, and xmlnode_* API with purple_xmlnode_* API
Ankit Vani <a@nevitus.org>
parents:
34910
diff
changeset
|
680 | PurpleXmlNode *iq = purple_xmlnode_new("iq"); |
|
686fa55b0deb
Replaced xmlnode with PurpleXmlNode, and xmlnode_* API with purple_xmlnode_* API
Ankit Vani <a@nevitus.org>
parents:
34910
diff
changeset
|
681 | purple_xmlnode_set_attrib(iq, "to", from); |
|
686fa55b0deb
Replaced xmlnode with PurpleXmlNode, and xmlnode_* API with purple_xmlnode_* API
Ankit Vani <a@nevitus.org>
parents:
34910
diff
changeset
|
682 | purple_xmlnode_set_attrib(iq, "id", id); |
|
686fa55b0deb
Replaced xmlnode with PurpleXmlNode, and xmlnode_* API with purple_xmlnode_* API
Ankit Vani <a@nevitus.org>
parents:
34910
diff
changeset
|
683 | purple_xmlnode_set_attrib(iq, "type", "result"); |
|
27223
d41e83f82148
Examples for the namespace-(un)registering of IQs and added IPC versions
Paul Aurich <darkrain42@pidgin.im>
parents:
27160
diff
changeset
|
684 | |
|
36623
caaadef03507
Renamed purple_connection_get_protocol_info() to purple_connection_get_protocol()
Ankit Vani <a@nevitus.org>
parents:
36574
diff
changeset
|
685 | purple_signal_emit(purple_connection_get_protocol(pc), |
|
27226
e86922c96573
Use the modified signal in more places.
Paul Aurich <darkrain42@pidgin.im>
parents:
27224
diff
changeset
|
686 | "jabber-sending-xmlnode", pc, &iq); |
|
e86922c96573
Use the modified signal in more places.
Paul Aurich <darkrain42@pidgin.im>
parents:
27224
diff
changeset
|
687 | if (iq != NULL) |
|
34935
686fa55b0deb
Replaced xmlnode with PurpleXmlNode, and xmlnode_* API with purple_xmlnode_* API
Ankit Vani <a@nevitus.org>
parents:
34910
diff
changeset
|
688 | purple_xmlnode_free(iq); |
|
27223
d41e83f82148
Examples for the namespace-(un)registering of IQs and added IPC versions
Paul Aurich <darkrain42@pidgin.im>
parents:
27160
diff
changeset
|
689 | } |
|
d41e83f82148
Examples for the namespace-(un)registering of IQs and added IPC versions
Paul Aurich <darkrain42@pidgin.im>
parents:
27160
diff
changeset
|
690 | |
|
36637
9b0109ae118d
Renamed some prpl stuff to protocol stuff.
Ankit Vani <a@nevitus.org>
parents:
36623
diff
changeset
|
691 | /* Cookie monster eats IQ stanzas; the protocol shouldn't keep processing */ |
|
27223
d41e83f82148
Examples for the namespace-(un)registering of IQs and added IPC versions
Paul Aurich <darkrain42@pidgin.im>
parents:
27160
diff
changeset
|
692 | return TRUE; |
|
d41e83f82148
Examples for the namespace-(un)registering of IQs and added IPC versions
Paul Aurich <darkrain42@pidgin.im>
parents:
27160
diff
changeset
|
693 | } |
|
d41e83f82148
Examples for the namespace-(un)registering of IQs and added IPC versions
Paul Aurich <darkrain42@pidgin.im>
parents:
27160
diff
changeset
|
694 | |
|
27159
4629464a3430
Add the XMPP signals to the signals-test plugin
Paul Aurich <darkrain42@pidgin.im>
parents:
27023
diff
changeset
|
695 | /************************************************************************** |
| 6485 | 696 | * Plugin stuff |
| 697 | **************************************************************************/ | |
| 36742 | 698 | static PurplePluginInfo * |
| 699 | plugin_query(GError **error) | |
| 700 | { | |
| 701 | const gchar * const authors[] = { | |
| 702 | "Christian Hammond <chipx86@gnupdate.org>", | |
| 703 | NULL | |
| 704 | }; | |
| 705 | ||
| 706 | return purple_plugin_info_new( | |
| 707 | "id", SIGNAL_TEST_PLUGIN_ID, | |
| 708 | "name", N_("Signals Test"), | |
| 709 | "version", DISPLAY_VERSION, | |
| 710 | "category", N_("Testing"), | |
| 711 | "summary", N_("Test to see that all signals are working properly."), | |
| 712 | "description", N_("Test to see that all signals are working properly."), | |
| 713 | "authors", authors, | |
| 714 | "website", PURPLE_WEBSITE, | |
| 715 | "abi-version", PURPLE_ABI_VERSION, | |
| 716 | NULL | |
| 717 | ); | |
| 718 | } | |
| 719 | ||
| 6485 | 720 | static gboolean |
| 36742 | 721 | plugin_load(PurplePlugin *plugin, GError **error) |
| 6485 | 722 | { |
| 15884 | 723 | void *core_handle = purple_get_core(); |
| 724 | void *blist_handle = purple_blist_get_handle(); | |
| 725 | void *conn_handle = purple_connections_get_handle(); | |
| 726 | void *conv_handle = purple_conversations_get_handle(); | |
| 727 | void *accounts_handle = purple_accounts_get_handle(); | |
| 728 | void *ft_handle = purple_xfers_get_handle(); | |
| 729 | void *sound_handle = purple_sounds_get_handle(); | |
|
18976
fcf071533791
Email notification signals from charkins. Fixes #1324
Sean Egan <seanegan@pidgin.im>
parents:
16786
diff
changeset
|
730 | void *notify_handle = purple_notify_get_handle(); |
|
37005
702a601fc2ca
Update protocol IDs in codebase
Ankit Vani <a@nevitus.org>
parents:
36742
diff
changeset
|
731 | void *jabber_handle = purple_protocols_find("prpl-jabber"); |
| 6485 | 732 | |
| 733 | /* Accounts subsystem signals */ | |
| 15884 | 734 | purple_signal_connect(accounts_handle, "account-connecting", |
| 735 | plugin, PURPLE_CALLBACK(account_connecting_cb), NULL); | |
| 736 | purple_signal_connect(accounts_handle, "account-setting-info", | |
| 737 | plugin, PURPLE_CALLBACK(account_setting_info_cb), NULL); | |
| 738 | purple_signal_connect(accounts_handle, "account-set-info", | |
| 739 | plugin, PURPLE_CALLBACK(account_set_info_cb), NULL); | |
| 740 | purple_signal_connect(accounts_handle, "account-status-changed", | |
| 741 | plugin, PURPLE_CALLBACK(account_status_changed), NULL); | |
| 742 | purple_signal_connect(accounts_handle, "account-alias-changed", | |
| 743 | plugin, PURPLE_CALLBACK(account_alias_changed), NULL); | |
|
20421
e6c82f6c2485
Authorization signals. Modified patch from cockroach. Closes #1061.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
19859
diff
changeset
|
744 | purple_signal_connect(accounts_handle, "account-authorization-requested", |
|
e6c82f6c2485
Authorization signals. Modified patch from cockroach. Closes #1061.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
19859
diff
changeset
|
745 | plugin, PURPLE_CALLBACK(account_authorization_requested_cb), NULL); |
|
e6c82f6c2485
Authorization signals. Modified patch from cockroach. Closes #1061.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
19859
diff
changeset
|
746 | purple_signal_connect(accounts_handle, "account-authorization-denied", |
|
e6c82f6c2485
Authorization signals. Modified patch from cockroach. Closes #1061.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
19859
diff
changeset
|
747 | plugin, PURPLE_CALLBACK(account_authorization_denied_cb), NULL); |
|
e6c82f6c2485
Authorization signals. Modified patch from cockroach. Closes #1061.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
19859
diff
changeset
|
748 | purple_signal_connect(accounts_handle, "account-authorization-granted", |
|
e6c82f6c2485
Authorization signals. Modified patch from cockroach. Closes #1061.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
19859
diff
changeset
|
749 | plugin, PURPLE_CALLBACK(account_authorization_granted_cb), NULL); |
| 6485 | 750 | |
| 751 | /* Buddy List subsystem signals */ | |
| 15884 | 752 | purple_signal_connect(blist_handle, "buddy-status-changed", |
| 753 | plugin, PURPLE_CALLBACK(buddy_status_changed_cb), NULL); | |
| 754 | purple_signal_connect(blist_handle, "buddy-idle-changed", | |
| 755 | plugin, PURPLE_CALLBACK(buddy_idle_changed_cb), NULL); | |
| 756 | purple_signal_connect(blist_handle, "buddy-signed-on", | |
| 757 | plugin, PURPLE_CALLBACK(buddy_signed_on_cb), NULL); | |
| 758 | purple_signal_connect(blist_handle, "buddy-signed-off", | |
| 759 | plugin, PURPLE_CALLBACK(buddy_signed_off_cb), NULL); | |
|
27023
f7d6ee5315c9
Add blist-node-(added|removed) and deprecate buddy-(added|removed). Closes #8309
Paul Aurich <darkrain42@pidgin.im>
parents:
24531
diff
changeset
|
760 | purple_signal_connect(blist_handle, "blist-node-added", |
|
f7d6ee5315c9
Add blist-node-(added|removed) and deprecate buddy-(added|removed). Closes #8309
Paul Aurich <darkrain42@pidgin.im>
parents:
24531
diff
changeset
|
761 | plugin, PURPLE_CALLBACK(blist_node_added_cb), NULL); |
|
f7d6ee5315c9
Add blist-node-(added|removed) and deprecate buddy-(added|removed). Closes #8309
Paul Aurich <darkrain42@pidgin.im>
parents:
24531
diff
changeset
|
762 | purple_signal_connect(blist_handle, "blist-node-removed", |
|
f7d6ee5315c9
Add blist-node-(added|removed) and deprecate buddy-(added|removed). Closes #8309
Paul Aurich <darkrain42@pidgin.im>
parents:
24531
diff
changeset
|
763 | plugin, PURPLE_CALLBACK(blist_node_removed_cb), NULL); |
| 15884 | 764 | purple_signal_connect(blist_handle, "buddy-icon-changed", |
| 765 | plugin, PURPLE_CALLBACK(buddy_icon_changed_cb), NULL); | |
| 766 | purple_signal_connect(blist_handle, "blist-node-aliased", | |
| 767 | plugin, PURPLE_CALLBACK(blist_node_aliased), NULL); | |
| 768 | purple_signal_connect(blist_handle, "blist-node-extended-menu", | |
| 769 | plugin, PURPLE_CALLBACK(blist_node_extended_menu_cb), NULL); | |
| 6485 | 770 | |
| 771 | /* Connection subsystem signals */ | |
| 15884 | 772 | purple_signal_connect(conn_handle, "signing-on", |
| 773 | plugin, PURPLE_CALLBACK(signing_on_cb), NULL); | |
| 774 | purple_signal_connect(conn_handle, "signed-on", | |
| 775 | plugin, PURPLE_CALLBACK(signed_on_cb), NULL); | |
| 776 | purple_signal_connect(conn_handle, "signing-off", | |
| 777 | plugin, PURPLE_CALLBACK(signing_off_cb), NULL); | |
| 778 | purple_signal_connect(conn_handle, "signed-off", | |
| 779 | plugin, PURPLE_CALLBACK(signed_off_cb), NULL); | |
|
21285
ca8cb8706802
I figured a signal firing on a connection error would be useful.
Will Thompson <resiak@pidgin.im>
parents:
20421
diff
changeset
|
780 | purple_signal_connect(conn_handle, "connection-error", |
|
ca8cb8706802
I figured a signal firing on a connection error would be useful.
Will Thompson <resiak@pidgin.im>
parents:
20421
diff
changeset
|
781 | plugin, PURPLE_CALLBACK(connection_error_cb), NULL); |
| 6485 | 782 | |
| 783 | /* Conversations subsystem signals */ | |
| 15884 | 784 | purple_signal_connect(conv_handle, "writing-im-msg", |
| 785 | plugin, PURPLE_CALLBACK(writing_im_msg_cb), NULL); | |
| 786 | purple_signal_connect(conv_handle, "wrote-im-msg", | |
| 787 | plugin, PURPLE_CALLBACK(wrote_im_msg_cb), NULL); | |
| 788 | purple_signal_connect(conv_handle, "sending-im-msg", | |
| 789 | plugin, PURPLE_CALLBACK(sending_im_msg_cb), NULL); | |
| 790 | purple_signal_connect(conv_handle, "sent-im-msg", | |
| 791 | plugin, PURPLE_CALLBACK(sent_im_msg_cb), NULL); | |
| 792 | purple_signal_connect(conv_handle, "receiving-im-msg", | |
| 793 | plugin, PURPLE_CALLBACK(receiving_im_msg_cb), NULL); | |
| 794 | purple_signal_connect(conv_handle, "received-im-msg", | |
| 795 | plugin, PURPLE_CALLBACK(received_im_msg_cb), NULL); | |
| 796 | purple_signal_connect(conv_handle, "writing-chat-msg", | |
| 797 | plugin, PURPLE_CALLBACK(writing_chat_msg_cb), NULL); | |
| 798 | purple_signal_connect(conv_handle, "wrote-chat-msg", | |
| 799 | plugin, PURPLE_CALLBACK(wrote_chat_msg_cb), NULL); | |
| 800 | purple_signal_connect(conv_handle, "sending-chat-msg", | |
| 801 | plugin, PURPLE_CALLBACK(sending_chat_msg_cb), NULL); | |
| 802 | purple_signal_connect(conv_handle, "sent-chat-msg", | |
| 803 | plugin, PURPLE_CALLBACK(sent_chat_msg_cb), NULL); | |
| 804 | purple_signal_connect(conv_handle, "receiving-chat-msg", | |
| 805 | plugin, PURPLE_CALLBACK(receiving_chat_msg_cb), NULL); | |
| 806 | purple_signal_connect(conv_handle, "received-chat-msg", | |
| 807 | plugin, PURPLE_CALLBACK(received_chat_msg_cb), NULL); | |
| 808 | purple_signal_connect(conv_handle, "conversation-created", | |
| 809 | plugin, PURPLE_CALLBACK(conversation_created_cb), NULL); | |
| 810 | purple_signal_connect(conv_handle, "deleting-conversation", | |
| 811 | plugin, PURPLE_CALLBACK(deleting_conversation_cb), NULL); | |
| 812 | purple_signal_connect(conv_handle, "buddy-typing", | |
| 813 | plugin, PURPLE_CALLBACK(buddy_typing_cb), NULL); | |
| 814 | purple_signal_connect(conv_handle, "buddy-typing-stopped", | |
| 815 | plugin, PURPLE_CALLBACK(buddy_typing_stopped_cb), NULL); | |
|
34670
9bd5bd903dc7
Renamed chat buddies to chat users, and IM conversation typing state to IM typing state.
Ankit Vani <a@nevitus.org>
parents:
34669
diff
changeset
|
816 | purple_signal_connect(conv_handle, "chat-user-joining", |
|
9bd5bd903dc7
Renamed chat buddies to chat users, and IM conversation typing state to IM typing state.
Ankit Vani <a@nevitus.org>
parents:
34669
diff
changeset
|
817 | plugin, PURPLE_CALLBACK(chat_user_joining_cb), NULL); |
|
9bd5bd903dc7
Renamed chat buddies to chat users, and IM conversation typing state to IM typing state.
Ankit Vani <a@nevitus.org>
parents:
34669
diff
changeset
|
818 | purple_signal_connect(conv_handle, "chat-user-joined", |
|
9bd5bd903dc7
Renamed chat buddies to chat users, and IM conversation typing state to IM typing state.
Ankit Vani <a@nevitus.org>
parents:
34669
diff
changeset
|
819 | plugin, PURPLE_CALLBACK(chat_user_joined_cb), NULL); |
|
9bd5bd903dc7
Renamed chat buddies to chat users, and IM conversation typing state to IM typing state.
Ankit Vani <a@nevitus.org>
parents:
34669
diff
changeset
|
820 | purple_signal_connect(conv_handle, "chat-user-flags", |
|
9bd5bd903dc7
Renamed chat buddies to chat users, and IM conversation typing state to IM typing state.
Ankit Vani <a@nevitus.org>
parents:
34669
diff
changeset
|
821 | plugin, PURPLE_CALLBACK(chat_user_flags_cb), NULL); |
|
9bd5bd903dc7
Renamed chat buddies to chat users, and IM conversation typing state to IM typing state.
Ankit Vani <a@nevitus.org>
parents:
34669
diff
changeset
|
822 | purple_signal_connect(conv_handle, "chat-user-leaving", |
|
9bd5bd903dc7
Renamed chat buddies to chat users, and IM conversation typing state to IM typing state.
Ankit Vani <a@nevitus.org>
parents:
34669
diff
changeset
|
823 | plugin, PURPLE_CALLBACK(chat_user_leaving_cb), NULL); |
|
9bd5bd903dc7
Renamed chat buddies to chat users, and IM conversation typing state to IM typing state.
Ankit Vani <a@nevitus.org>
parents:
34669
diff
changeset
|
824 | purple_signal_connect(conv_handle, "chat-user-left", |
|
9bd5bd903dc7
Renamed chat buddies to chat users, and IM conversation typing state to IM typing state.
Ankit Vani <a@nevitus.org>
parents:
34669
diff
changeset
|
825 | plugin, PURPLE_CALLBACK(chat_user_left_cb), NULL); |
| 15884 | 826 | purple_signal_connect(conv_handle, "chat-inviting-user", |
| 827 | plugin, PURPLE_CALLBACK(chat_inviting_user_cb), NULL); | |
| 828 | purple_signal_connect(conv_handle, "chat-invited-user", | |
| 829 | plugin, PURPLE_CALLBACK(chat_invited_user_cb), NULL); | |
| 830 | purple_signal_connect(conv_handle, "chat-invited", | |
| 831 | plugin, PURPLE_CALLBACK(chat_invited_cb), NULL); | |
| 832 | purple_signal_connect(conv_handle, "chat-joined", | |
| 833 | plugin, PURPLE_CALLBACK(chat_joined_cb), NULL); | |
| 834 | purple_signal_connect(conv_handle, "chat-left", | |
| 835 | plugin, PURPLE_CALLBACK(chat_left_cb), NULL); | |
| 836 | purple_signal_connect(conv_handle, "chat-topic-changed", | |
| 837 | plugin, PURPLE_CALLBACK(chat_topic_changed_cb), NULL); | |
| 6485 | 838 | |
| 839 | /* Core signals */ | |
| 15884 | 840 | purple_signal_connect(core_handle, "quitting", |
| 841 | plugin, PURPLE_CALLBACK(quitting_cb), NULL); | |
|
29189
141cdbeab2a5
Add support for the uri-handler signal to the signals-test plugin
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
28981
diff
changeset
|
842 | purple_signal_connect(core_handle, "uri-handler", |
|
141cdbeab2a5
Add support for the uri-handler signal to the signals-test plugin
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
28981
diff
changeset
|
843 | plugin, PURPLE_CALLBACK(uri_handler), NULL); |
| 6485 | 844 | |
| 12291 | 845 | /* File transfer signals */ |
| 15884 | 846 | purple_signal_connect(ft_handle, "file-recv-accept", |
| 847 | plugin, PURPLE_CALLBACK(ft_recv_accept_cb), NULL); | |
| 848 | purple_signal_connect(ft_handle, "file-recv-start", | |
| 849 | plugin, PURPLE_CALLBACK(ft_recv_start_cb), NULL); | |
| 850 | purple_signal_connect(ft_handle, "file-recv-cancel", | |
| 851 | plugin, PURPLE_CALLBACK(ft_recv_cancel_cb), NULL); | |
| 852 | purple_signal_connect(ft_handle, "file-recv-complete", | |
| 853 | plugin, PURPLE_CALLBACK(ft_recv_complete_cb), NULL); | |
| 854 | purple_signal_connect(ft_handle, "file-send-accept", | |
| 855 | plugin, PURPLE_CALLBACK(ft_send_accept_cb), NULL); | |
| 856 | purple_signal_connect(ft_handle, "file-send-start", | |
| 857 | plugin, PURPLE_CALLBACK(ft_send_start_cb), NULL); | |
| 858 | purple_signal_connect(ft_handle, "file-send-cancel", | |
| 859 | plugin, PURPLE_CALLBACK(ft_send_cancel_cb), NULL); | |
| 860 | purple_signal_connect(ft_handle, "file-send-complete", | |
| 861 | plugin, PURPLE_CALLBACK(ft_send_complete_cb), NULL); | |
|
11281
a5cda37a16be
[gaim-migrate @ 13478]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
11256
diff
changeset
|
862 | |
| 12291 | 863 | /* Sound signals */ |
| 15884 | 864 | purple_signal_connect(sound_handle, "playing-sound-event", plugin, |
| 865 | PURPLE_CALLBACK(sound_playing_event_cb), NULL); | |
| 12291 | 866 | |
|
18976
fcf071533791
Email notification signals from charkins. Fixes #1324
Sean Egan <seanegan@pidgin.im>
parents:
16786
diff
changeset
|
867 | /* Notify signals */ |
|
fcf071533791
Email notification signals from charkins. Fixes #1324
Sean Egan <seanegan@pidgin.im>
parents:
16786
diff
changeset
|
868 | purple_signal_connect(notify_handle, "displaying-email-notification", |
|
fcf071533791
Email notification signals from charkins. Fixes #1324
Sean Egan <seanegan@pidgin.im>
parents:
16786
diff
changeset
|
869 | plugin, PURPLE_CALLBACK(notify_email_cb), NULL); |
|
fcf071533791
Email notification signals from charkins. Fixes #1324
Sean Egan <seanegan@pidgin.im>
parents:
16786
diff
changeset
|
870 | purple_signal_connect(notify_handle, "displaying-emails-notification", |
|
fcf071533791
Email notification signals from charkins. Fixes #1324
Sean Egan <seanegan@pidgin.im>
parents:
16786
diff
changeset
|
871 | plugin, PURPLE_CALLBACK(notify_emails_cb), NULL); |
|
fcf071533791
Email notification signals from charkins. Fixes #1324
Sean Egan <seanegan@pidgin.im>
parents:
16786
diff
changeset
|
872 | |
|
27159
4629464a3430
Add the XMPP signals to the signals-test plugin
Paul Aurich <darkrain42@pidgin.im>
parents:
27023
diff
changeset
|
873 | /* Jabber signals */ |
|
4629464a3430
Add the XMPP signals to the signals-test plugin
Paul Aurich <darkrain42@pidgin.im>
parents:
27023
diff
changeset
|
874 | if (jabber_handle) { |
|
4629464a3430
Add the XMPP signals to the signals-test plugin
Paul Aurich <darkrain42@pidgin.im>
parents:
27023
diff
changeset
|
875 | purple_signal_connect(jabber_handle, "jabber-receiving-iq", plugin, |
|
4629464a3430
Add the XMPP signals to the signals-test plugin
Paul Aurich <darkrain42@pidgin.im>
parents:
27023
diff
changeset
|
876 | PURPLE_CALLBACK(jabber_iq_received), NULL); |
|
4629464a3430
Add the XMPP signals to the signals-test plugin
Paul Aurich <darkrain42@pidgin.im>
parents:
27023
diff
changeset
|
877 | purple_signal_connect(jabber_handle, "jabber-receiving-message", plugin, |
|
4629464a3430
Add the XMPP signals to the signals-test plugin
Paul Aurich <darkrain42@pidgin.im>
parents:
27023
diff
changeset
|
878 | PURPLE_CALLBACK(jabber_message_received), NULL); |
|
4629464a3430
Add the XMPP signals to the signals-test plugin
Paul Aurich <darkrain42@pidgin.im>
parents:
27023
diff
changeset
|
879 | purple_signal_connect(jabber_handle, "jabber-receiving-presence", plugin, |
|
4629464a3430
Add the XMPP signals to the signals-test plugin
Paul Aurich <darkrain42@pidgin.im>
parents:
27023
diff
changeset
|
880 | PURPLE_CALLBACK(jabber_presence_received), NULL); |
|
27223
d41e83f82148
Examples for the namespace-(un)registering of IQs and added IPC versions
Paul Aurich <darkrain42@pidgin.im>
parents:
27160
diff
changeset
|
881 | |
|
d41e83f82148
Examples for the namespace-(un)registering of IQs and added IPC versions
Paul Aurich <darkrain42@pidgin.im>
parents:
27160
diff
changeset
|
882 | /* IQ namespace signals */ |
|
d41e83f82148
Examples for the namespace-(un)registering of IQs and added IPC versions
Paul Aurich <darkrain42@pidgin.im>
parents:
27160
diff
changeset
|
883 | purple_signal_emit(jabber_handle, "jabber-register-namespace-watcher", |
|
d41e83f82148
Examples for the namespace-(un)registering of IQs and added IPC versions
Paul Aurich <darkrain42@pidgin.im>
parents:
27160
diff
changeset
|
884 | "bogus_node", "super-duper-namespace"); |
|
d41e83f82148
Examples for the namespace-(un)registering of IQs and added IPC versions
Paul Aurich <darkrain42@pidgin.im>
parents:
27160
diff
changeset
|
885 | /* The above is equivalent to doing: |
|
d41e83f82148
Examples for the namespace-(un)registering of IQs and added IPC versions
Paul Aurich <darkrain42@pidgin.im>
parents:
27160
diff
changeset
|
886 | int result = GPOINTER_TO_INT(purple_plugin_ipc_call(jabber_handle, "register_namespace_watcher", &ok, "bogus_node", "super-duper-namespace")); |
|
d41e83f82148
Examples for the namespace-(un)registering of IQs and added IPC versions
Paul Aurich <darkrain42@pidgin.im>
parents:
27160
diff
changeset
|
887 | */ |
|
d41e83f82148
Examples for the namespace-(un)registering of IQs and added IPC versions
Paul Aurich <darkrain42@pidgin.im>
parents:
27160
diff
changeset
|
888 | |
|
d41e83f82148
Examples for the namespace-(un)registering of IQs and added IPC versions
Paul Aurich <darkrain42@pidgin.im>
parents:
27160
diff
changeset
|
889 | purple_signal_connect(jabber_handle, "jabber-watched-iq", plugin, |
|
d41e83f82148
Examples for the namespace-(un)registering of IQs and added IPC versions
Paul Aurich <darkrain42@pidgin.im>
parents:
27160
diff
changeset
|
890 | PURPLE_CALLBACK(jabber_watched_iq), NULL); |
|
27159
4629464a3430
Add the XMPP signals to the signals-test plugin
Paul Aurich <darkrain42@pidgin.im>
parents:
27023
diff
changeset
|
891 | } |
|
4629464a3430
Add the XMPP signals to the signals-test plugin
Paul Aurich <darkrain42@pidgin.im>
parents:
27023
diff
changeset
|
892 | |
|
4629464a3430
Add the XMPP signals to the signals-test plugin
Paul Aurich <darkrain42@pidgin.im>
parents:
27023
diff
changeset
|
893 | return TRUE; |
|
4629464a3430
Add the XMPP signals to the signals-test plugin
Paul Aurich <darkrain42@pidgin.im>
parents:
27023
diff
changeset
|
894 | } |
|
4629464a3430
Add the XMPP signals to the signals-test plugin
Paul Aurich <darkrain42@pidgin.im>
parents:
27023
diff
changeset
|
895 | |
|
4629464a3430
Add the XMPP signals to the signals-test plugin
Paul Aurich <darkrain42@pidgin.im>
parents:
27023
diff
changeset
|
896 | static gboolean |
| 36742 | 897 | plugin_unload(PurplePlugin *plugin, GError **error) |
|
27159
4629464a3430
Add the XMPP signals to the signals-test plugin
Paul Aurich <darkrain42@pidgin.im>
parents:
27023
diff
changeset
|
898 | { |
|
37005
702a601fc2ca
Update protocol IDs in codebase
Ankit Vani <a@nevitus.org>
parents:
36742
diff
changeset
|
899 | void *jabber_handle = purple_protocols_find("prpl-jabber"); |
|
27223
d41e83f82148
Examples for the namespace-(un)registering of IQs and added IPC versions
Paul Aurich <darkrain42@pidgin.im>
parents:
27160
diff
changeset
|
900 | |
|
27159
4629464a3430
Add the XMPP signals to the signals-test plugin
Paul Aurich <darkrain42@pidgin.im>
parents:
27023
diff
changeset
|
901 | purple_signals_disconnect_by_handle(plugin); |
|
4629464a3430
Add the XMPP signals to the signals-test plugin
Paul Aurich <darkrain42@pidgin.im>
parents:
27023
diff
changeset
|
902 | |
|
27223
d41e83f82148
Examples for the namespace-(un)registering of IQs and added IPC versions
Paul Aurich <darkrain42@pidgin.im>
parents:
27160
diff
changeset
|
903 | if (jabber_handle) { |
|
d41e83f82148
Examples for the namespace-(un)registering of IQs and added IPC versions
Paul Aurich <darkrain42@pidgin.im>
parents:
27160
diff
changeset
|
904 | /* Unregister watched namespaces */ |
|
d41e83f82148
Examples for the namespace-(un)registering of IQs and added IPC versions
Paul Aurich <darkrain42@pidgin.im>
parents:
27160
diff
changeset
|
905 | purple_signal_emit(jabber_handle, "jabber-unregister-namespace-watcher", |
|
d41e83f82148
Examples for the namespace-(un)registering of IQs and added IPC versions
Paul Aurich <darkrain42@pidgin.im>
parents:
27160
diff
changeset
|
906 | "bogus_node", "super-duper-namespace"); |
|
d41e83f82148
Examples for the namespace-(un)registering of IQs and added IPC versions
Paul Aurich <darkrain42@pidgin.im>
parents:
27160
diff
changeset
|
907 | /* The above is equivalent to doing: |
|
d41e83f82148
Examples for the namespace-(un)registering of IQs and added IPC versions
Paul Aurich <darkrain42@pidgin.im>
parents:
27160
diff
changeset
|
908 | int result = GPOINTER_TO_INT(purple_plugin_ipc_call(jabber_handle, "unregister_namespace_watcher", &ok, "bogus_node", "super-duper-namespace")); |
|
d41e83f82148
Examples for the namespace-(un)registering of IQs and added IPC versions
Paul Aurich <darkrain42@pidgin.im>
parents:
27160
diff
changeset
|
909 | */ |
|
d41e83f82148
Examples for the namespace-(un)registering of IQs and added IPC versions
Paul Aurich <darkrain42@pidgin.im>
parents:
27160
diff
changeset
|
910 | } |
|
d41e83f82148
Examples for the namespace-(un)registering of IQs and added IPC versions
Paul Aurich <darkrain42@pidgin.im>
parents:
27160
diff
changeset
|
911 | |
| 6485 | 912 | return TRUE; |
| 913 | } | |
| 914 | ||
| 36742 | 915 | PURPLE_PLUGIN_INIT(signalstest, plugin_query, plugin_load, plugin_unload); |