Mercurial > pidgin
comparison libpurple/protocols/null/nullprpl.c @ 31086:a8cc50c2279f
Remove trailing whitespace
author | Richard Laager <rlaager@wiktel.com> |
---|---|
date | Tue, 04 Jan 2011 06:55:30 +0000 |
parents | 2a436e0ce977 |
children | 3c0343e88c71 |
comparison
equal
deleted
inserted
replaced
31085:44f53d3fc54f | 31086:a8cc50c2279f |
---|---|
6 * source distribution. | 6 * source distribution. |
7 * | 7 * |
8 * Nullprpl is a mock protocol plugin for Pidgin and libpurple. You can create | 8 * Nullprpl is a mock protocol plugin for Pidgin and libpurple. You can create |
9 * accounts with it, sign on and off, add buddies, and send and receive IMs, | 9 * accounts with it, sign on and off, add buddies, and send and receive IMs, |
10 * all without connecting to a server! | 10 * all without connecting to a server! |
11 * | 11 * |
12 * Beyond that basic functionality, nullprpl supports presence and | 12 * Beyond that basic functionality, nullprpl supports presence and |
13 * away/available messages, offline messages, user info, typing notification, | 13 * away/available messages, offline messages, user info, typing notification, |
14 * privacy allow/block lists, chat rooms, whispering, room lists, and protocol | 14 * privacy allow/block lists, chat rooms, whispering, room lists, and protocol |
15 * icons and emblems. Notable missing features are file transfer and account | 15 * icons and emblems. Notable missing features are file transfer and account |
16 * registration and authentication. | 16 * registration and authentication. |
17 * | 17 * |
18 * Nullprpl is intended as an example of how to write a libpurple protocol | 18 * Nullprpl is intended as an example of how to write a libpurple protocol |
19 * plugin. It doesn't contain networking code or an event loop, but it does | 19 * plugin. It doesn't contain networking code or an event loop, but it does |
20 * demonstrate how to use the libpurple API to do pretty much everything a prpl | 20 * demonstrate how to use the libpurple API to do pretty much everything a prpl |
21 * might need to do. | 21 * might need to do. |
22 * | 22 * |
23 * Nullprpl is also a useful tool for hacking on Pidgin, Finch, and other | 23 * Nullprpl is also a useful tool for hacking on Pidgin, Finch, and other |
24 * libpurple clients. It's a full-featured protocol plugin, but doesn't depend | 24 * libpurple clients. It's a full-featured protocol plugin, but doesn't depend |
25 * on an external server, so it's a quick and easy way to exercise test new | 25 * on an external server, so it's a quick and easy way to exercise test new |
26 * code. It also allows you to work while you're disconnected. | 26 * code. It also allows you to work while you're disconnected. |
27 * | 27 * |
189 to->account->username, from->account->username); | 189 to->account->username, from->account->username); |
190 discover_status(to, from, NULL); | 190 discover_status(to, from, NULL); |
191 } | 191 } |
192 | 192 |
193 | 193 |
194 /* | 194 /* |
195 * UI callbacks | 195 * UI callbacks |
196 */ | 196 */ |
197 static void nullprpl_input_user_info(PurplePluginAction *action) | 197 static void nullprpl_input_user_info(PurplePluginAction *action) |
198 { | 198 { |
199 PurpleConnection *gc = (PurpleConnection *)action->context; | 199 PurpleConnection *gc = (PurpleConnection *)action->context; |
353 "'room' = 'default'\n"); | 353 "'room' = 'default'\n"); |
354 | 354 |
355 defaults = g_hash_table_new_full(g_str_hash, g_str_equal, NULL, g_free); | 355 defaults = g_hash_table_new_full(g_str_hash, g_str_equal, NULL, g_free); |
356 g_hash_table_insert(defaults, "room", g_strdup("default")); | 356 g_hash_table_insert(defaults, "room", g_strdup("default")); |
357 return defaults; | 357 return defaults; |
358 } | 358 } |
359 | 359 |
360 static void nullprpl_login(PurpleAccount *acct) | 360 static void nullprpl_login(PurpleAccount *acct) |
361 { | 361 { |
362 PurpleConnection *gc = purple_account_get_connection(acct); | 362 PurpleConnection *gc = purple_account_get_connection(acct); |
363 GList *offline_messages; | 363 GList *offline_messages; |
380 foreach_nullprpl_gc(report_status_change, gc, NULL); | 380 foreach_nullprpl_gc(report_status_change, gc, NULL); |
381 | 381 |
382 /* fetch stored offline messages */ | 382 /* fetch stored offline messages */ |
383 purple_debug_info("nullprpl", "checking for offline messages for %s\n", | 383 purple_debug_info("nullprpl", "checking for offline messages for %s\n", |
384 acct->username); | 384 acct->username); |
385 offline_messages = g_hash_table_lookup(goffline_messages, acct->username); | 385 offline_messages = g_hash_table_lookup(goffline_messages, acct->username); |
386 while (offline_messages) { | 386 while (offline_messages) { |
387 GOfflineMessage *message = (GOfflineMessage *)offline_messages->data; | 387 GOfflineMessage *message = (GOfflineMessage *)offline_messages->data; |
388 purple_debug_info("nullprpl", "delivering offline message to %s: %s\n", | 388 purple_debug_info("nullprpl", "delivering offline message to %s: %s\n", |
389 acct->username, message->message); | 389 acct->username, message->message); |
390 serv_got_im(gc, message->from, message->message, message->flags, | 390 serv_got_im(gc, message->from, message->message, message->flags, |