comparison plugins/events.c @ 5255:c0baa01cdeda

[gaim-migrate @ 5627] Paul A (darkrain) writes: " This patch updates the events.c, filectl.c, gaiminc.c, and mailchk.c plugins to the new api as well as updating mailchk.c to the new buddy list code. events.so, gaiminc.so, and mailchk.so all load and function properly on my computer. filectl doesn't even compile, but then, it has been a while since it did actually compile. I didn't even bother to update a few of the other plugins, since they're completely out of date. Perhaps one of the developers needs to go through and prune out a bunch of the plugins that are not kept up to date. Out of date plugins: chatlist.c - superceded by faceprint's recent commit to cvs. filectl.c - doesn't support multiple accounts for IMs and away messages. raw.c - does anyone use this? it doesn't compile, but it looks like an easy fix. " committer: Tailor Script <tailor@pidgin.im>
author Luke Schierer <lschiere@pidgin.im>
date Mon, 28 Apr 2003 18:45:38 +0000
parents fefad67de2c7
children dae79aefac8d
comparison
equal deleted inserted replaced
5254:d1e1ca490894 5255:c0baa01cdeda
1 /* tester.c 1 /* events.c
2 * 2 *
3 * test every callback, print to stdout 3 * test every callback, print to stdout
4 * 4 *
5 * by EW 5 * by EW
6 * 6 *
7 * GPL and all that jazz 7 * GPL and all that jazz
8 * 8 *
9 */ 9 */
10 10
11 #define GAIM_PLUGINS 11 #define EVENTTEST_PLUGIN_ID "core-eventtest"
12 #include "gaim.h" 12 #include "gaim.h"
13 13
14 static void evt_signon(struct gaim_connection *gc, void *data) 14 static void evt_signon(struct gaim_connection *gc, void *data)
15 { 15 {
16 printf("event_signon\n"); 16 printf("event_signon\n");
146 printf("event_im_displayed_sent: %s %s\n", who, *what); 146 printf("event_im_displayed_sent: %s %s\n", who, *what);
147 } 147 }
148 148
149 static void evt_im_displayed_rcvd(struct gaim_connection *gc, char *who, char *what, guint32 flags, time_t time, void *data) 149 static void evt_im_displayed_rcvd(struct gaim_connection *gc, char *who, char *what, guint32 flags, time_t time, void *data)
150 { 150 {
151 printf("event_im_displayed_rcvd: %s %s %s %s\n", who, what, flags, time); 151 printf("event_im_displayed_rcvd: %s %s %u %u\n", who, what, flags, time);
152 } 152 }
153 153
154 static void evt_chat_send_invite(struct gaim_connection *gc, int id, char *who, char **msg, void *data) 154 static void evt_chat_send_invite(struct gaim_connection *gc, int id, char *who, char **msg, void *data)
155 { 155 {
156 printf("event_chat_send_invite: %d %s %s\n", id, who, *msg); 156 printf("event_chat_send_invite: %d %s %s\n", id, who, *msg);
159 static evt_got_typing(struct gaim_connection *gc, char *who, void *data) 159 static evt_got_typing(struct gaim_connection *gc, char *who, void *data)
160 { 160 {
161 printf("event_got_typing: %s\n", who); 161 printf("event_got_typing: %s\n", who);
162 } 162 }
163 163
164 static evt_del_conversation(struct conversation *c, void *data) 164 static evt_del_conversation(struct gaim_conversation *c, void *data)
165 { 165 {
166 printf("event_del_conversation\n"); 166 printf("event_del_conversation\n");
167 } 167 }
168 168
169 static evt_connecting(struct gaim_account *u, void *data) 169 static evt_connecting(struct gaim_account *u, void *data)
170 { 170 {
171 printf("event_connecting\n"); 171 printf("event_connecting\n");
172 } 172 }
173 173
174 char *gaim_plugin_init(GModule *h) 174
175 { 175 /*
176 gaim_signal_connect(h, event_signon, evt_signon, NULL); 176 * EXPORTED FUNCTIONS
177 gaim_signal_connect(h, event_signoff, evt_signoff, NULL); 177 */
178 gaim_signal_connect(h, event_away, evt_away, NULL); 178
179 gaim_signal_connect(h, event_back, evt_back, NULL); 179 static gboolean
180 gaim_signal_connect(h, event_im_recv, evt_im_recv, NULL); 180 plugin_load(GaimPlugin *plugin)
181 gaim_signal_connect(h, event_im_send, evt_im_send, NULL); 181 {
182 gaim_signal_connect(h, event_buddy_signon, evt_buddy_signon, NULL); 182 gaim_signal_connect(plugin, event_signon, evt_signon, NULL);
183 gaim_signal_connect(h, event_buddy_signoff, evt_buddy_signoff, NULL); 183 gaim_signal_connect(plugin, event_signoff, evt_signoff, NULL);
184 gaim_signal_connect(h, event_buddy_away, evt_buddy_away, NULL); 184 gaim_signal_connect(plugin, event_away, evt_away, NULL);
185 gaim_signal_connect(h, event_buddy_back, evt_buddy_back, NULL); 185 gaim_signal_connect(plugin, event_back, evt_back, NULL);
186 gaim_signal_connect(h, event_chat_invited, evt_chat_invited, NULL); 186 gaim_signal_connect(plugin, event_im_recv, evt_im_recv, NULL);
187 gaim_signal_connect(h, event_chat_join, evt_chat_join, NULL); 187 gaim_signal_connect(plugin, event_im_send, evt_im_send, NULL);
188 gaim_signal_connect(h, event_chat_leave, evt_chat_leave, NULL); 188 gaim_signal_connect(plugin, event_buddy_signon, evt_buddy_signon, NULL);
189 gaim_signal_connect(h, event_chat_buddy_join, evt_chat_buddy_join, NULL); 189 gaim_signal_connect(plugin, event_buddy_signoff, evt_buddy_signoff, NULL);
190 gaim_signal_connect(h, event_chat_buddy_leave, evt_chat_buddy_leave, NULL); 190 gaim_signal_connect(plugin, event_buddy_away, evt_buddy_away, NULL);
191 gaim_signal_connect(h, event_chat_recv, evt_chat_recv, NULL); 191 gaim_signal_connect(plugin, event_buddy_back, evt_buddy_back, NULL);
192 gaim_signal_connect(h, event_chat_send, evt_chat_send, NULL); 192 gaim_signal_connect(plugin, event_chat_invited, evt_chat_invited, NULL);
193 gaim_signal_connect(h, event_warned, evt_warned, NULL); 193 gaim_signal_connect(plugin, event_chat_join, evt_chat_join, NULL);
194 gaim_signal_connect(h, event_error, evt_error, NULL); 194 gaim_signal_connect(plugin, event_chat_leave, evt_chat_leave, NULL);
195 gaim_signal_connect(h, event_quit, evt_quit, NULL); 195 gaim_signal_connect(plugin, event_chat_buddy_join, evt_chat_buddy_join, NULL);
196 gaim_signal_connect(h, event_new_conversation, evt_new_conversation, NULL); 196 gaim_signal_connect(plugin, event_chat_buddy_leave, evt_chat_buddy_leave, NULL);
197 gaim_signal_connect(h, event_set_info, evt_set_info, NULL); 197 gaim_signal_connect(plugin, event_chat_recv, evt_chat_recv, NULL);
198 gaim_signal_connect(h, event_draw_menu, evt_draw_menu, NULL); 198 gaim_signal_connect(plugin, event_chat_send, evt_chat_send, NULL);
199 gaim_signal_connect(h, event_im_displayed_sent, evt_im_displayed_sent, NULL); 199 gaim_signal_connect(plugin, event_warned, evt_warned, NULL);
200 gaim_signal_connect(h, event_im_displayed_rcvd, evt_im_displayed_rcvd, NULL); 200 gaim_signal_connect(plugin, event_error, evt_error, NULL);
201 gaim_signal_connect(h, event_chat_send_invite, evt_chat_send_invite, NULL); 201 gaim_signal_connect(plugin, event_quit, evt_quit, NULL);
202 gaim_signal_connect(h, event_got_typing, evt_got_typing, NULL); 202 gaim_signal_connect(plugin, event_new_conversation, evt_new_conversation, NULL);
203 gaim_signal_connect(h, event_del_conversation, evt_del_conversation, NULL); 203 gaim_signal_connect(plugin, event_set_info, evt_set_info, NULL);
204 gaim_signal_connect(h, event_connecting, evt_connecting, NULL); 204 gaim_signal_connect(plugin, event_draw_menu, evt_draw_menu, NULL);
205 return NULL; 205 gaim_signal_connect(plugin, event_im_displayed_sent, evt_im_displayed_sent, NULL);
206 } 206 gaim_signal_connect(plugin, event_im_displayed_rcvd, evt_im_displayed_rcvd, NULL);
207 207 gaim_signal_connect(plugin, event_chat_send_invite, evt_chat_send_invite, NULL);
208 struct gaim_plugin_description desc; 208 gaim_signal_connect(plugin, event_got_typing, evt_got_typing, NULL);
209 struct gaim_plugin_description *gaim_plugin_desc() { 209 gaim_signal_connect(plugin, event_del_conversation, evt_del_conversation, NULL);
210 desc.api_version = GAIM_PLUGIN_API_VERSION; 210 gaim_signal_connect(plugin, event_connecting, evt_connecting, NULL);
211 desc.name = g_strdup("Event Tester"); 211
212 desc.version = g_strdup(VERSION); 212 return TRUE;
213 desc.description = g_strdup("Test to see that all plugin events are working properly."); 213 }
214 desc.authors = g_strdup("Eric Warmehoven &lt;eric@warmenhoven.org>"); 214
215 desc.url = g_strdup(WEBSITE); 215 static GaimPluginInfo info =
216 return &desc; 216 {
217 } 217 2, /**< api_version */
218 218 GAIM_PLUGIN_STANDARD, /**< type */
219 char *name() 219 NULL, /**< ui_requirement */
220 { 220 0, /**< flags */
221 return "Event Test"; 221 NULL, /**< dependencies */
222 } 222 GAIM_PRIORITY_DEFAULT, /**< priority */
223 223
224 char *description() 224 EVENTTEST_PLUGIN_ID, /**< id */
225 { 225 N_("Event Test"), /**< name */
226 return "Test to see that all events are working properly."; 226 VERSION, /**< version */
227 } 227 /** summary */
228 N_("Test to see that all events are working properly."),
229 /** description */
230 N_("Test to see that all events are working properly."),
231 "Eric Warmenhoven <eric@warmenhoven.org>", /**< author */
232 WEBSITE, /**< homepage */
233
234 plugin_load, /**< load */
235 NULL, /**< unload */
236 NULL, /**< destroy */
237
238 NULL, /**< ui_info */
239 NULL /**< extra_info */
240 };
241
242 static void
243 __init_plugin(GaimPlugin *plugin)
244 {
245 }
246
247 GAIM_INIT_PLUGIN(eventtester, __init_plugin, info);