comparison plugins/signals-test.c @ 10684:72a5babfa8b4

[gaim-migrate @ 12231] the cipher api that grim has been working on for ages is finally done!! big congrats and thanks to him!! lots of modified files in this commit. it builds here. moved the md5 files to src/protocols/oscar so that it continues to depend on nothing in gaim. everything else uses the new centralized cipher api. I'm not sure if src/md5.* needs to be removed or not, so I left it there. someone let me know or do it directly. someone check if these need to be added to potfiles.in and let there be much rejoicing! committer: Tailor Script <tailor@pidgin.im>
author Luke Schierer <lschiere@pidgin.im>
date Fri, 11 Mar 2005 13:05:31 +0000
parents 60db14d54914
children 185ca25b5c7e
comparison
equal deleted inserted replaced
10683:e11f3e1599d4 10684:72a5babfa8b4
21 #define SIGNAL_TEST_PLUGIN_ID "core-signals-test" 21 #define SIGNAL_TEST_PLUGIN_ID "core-signals-test"
22 22
23 #include <stdio.h> 23 #include <stdio.h>
24 24
25 #include "internal.h" 25 #include "internal.h"
26 #include "cipher.h"
26 #include "connection.h" 27 #include "connection.h"
27 #include "conversation.h" 28 #include "conversation.h"
28 #include "core.h" 29 #include "core.h"
29 #include "debug.h" 30 #include "debug.h"
30 #include "signals.h" 31 #include "signals.h"
437 "chat-topic-changed (%s topic changed to: \"%s\" by %s)\n", 438 "chat-topic-changed (%s topic changed to: \"%s\" by %s)\n",
438 gaim_conversation_get_name(conv), topic, 439 gaim_conversation_get_name(conv), topic,
439 (who) ? who : "unknown"); 440 (who) ? who : "unknown");
440 } 441 }
441 /************************************************************************** 442 /**************************************************************************
443 * Ciphers signal callbacks
444 **************************************************************************/
445 static void
446 cipher_added_cb(GaimCipher *cipher, void *data) {
447 gaim_debug_misc("signals test", "cipher %s added\n",
448 gaim_cipher_get_name(cipher));
449 }
450
451 static void
452 cipher_removed_cb(GaimCipher *cipher, void *data) {
453 gaim_debug_misc("signals test", "cipher %s removed\n",
454 gaim_cipher_get_name(cipher));
455 }
456
457 /**************************************************************************
442 * Core signal callbacks 458 * Core signal callbacks
443 **************************************************************************/ 459 **************************************************************************/
444 static void 460 static void
445 quitting_cb(void *data) 461 quitting_cb(void *data)
446 { 462 {
456 void *core_handle = gaim_get_core(); 472 void *core_handle = gaim_get_core();
457 void *blist_handle = gaim_blist_get_handle(); 473 void *blist_handle = gaim_blist_get_handle();
458 void *conn_handle = gaim_connections_get_handle(); 474 void *conn_handle = gaim_connections_get_handle();
459 void *conv_handle = gaim_conversations_get_handle(); 475 void *conv_handle = gaim_conversations_get_handle();
460 void *accounts_handle = gaim_accounts_get_handle(); 476 void *accounts_handle = gaim_accounts_get_handle();
477 void *ciphers_handle = gaim_ciphers_get_handle();
461 478
462 /* Accounts subsystem signals */ 479 /* Accounts subsystem signals */
463 gaim_signal_connect(accounts_handle, "account-connecting", 480 gaim_signal_connect(accounts_handle, "account-connecting",
464 plugin, GAIM_CALLBACK(account_connecting_cb), NULL); 481 plugin, GAIM_CALLBACK(account_connecting_cb), NULL);
465 gaim_signal_connect(accounts_handle, "account-away", 482 gaim_signal_connect(accounts_handle, "account-away",
561 gaim_signal_connect(conv_handle, "chat-left", 578 gaim_signal_connect(conv_handle, "chat-left",
562 plugin, GAIM_CALLBACK(chat_left_cb), NULL); 579 plugin, GAIM_CALLBACK(chat_left_cb), NULL);
563 gaim_signal_connect(conv_handle, "chat-topic-changed", 580 gaim_signal_connect(conv_handle, "chat-topic-changed",
564 plugin, GAIM_CALLBACK(chat_topic_changed_cb), NULL); 581 plugin, GAIM_CALLBACK(chat_topic_changed_cb), NULL);
565 582
583 /* Ciphers signals */
584 gaim_signal_connect(ciphers_handle, "cipher-added",
585 plugin, GAIM_CALLBACK(cipher_added_cb), NULL);
586 gaim_signal_connect(ciphers_handle, "cipher-removed",
587 plugin, GAIM_CALLBACK(cipher_removed_cb), NULL);
588
566 /* Core signals */ 589 /* Core signals */
567 gaim_signal_connect(core_handle, "quitting", 590 gaim_signal_connect(core_handle, "quitting",
568 plugin, GAIM_CALLBACK(quitting_cb), NULL); 591 plugin, GAIM_CALLBACK(quitting_cb), NULL);
569 592
570 return TRUE; 593 return TRUE;