Mercurial > pidgin.yaz
comparison libpurple/plugins/signals-test.c @ 18771:6ecbb322a803
merge of '5fbd62e0397f65bf7b8def7a4ad421e0044d429c'
and 'aea49b9a427019527ec0e314f70a35c7defe0d89'
author | Kevin Stange <kevin@simguy.net> |
---|---|
date | Thu, 02 Aug 2007 04:16:37 +0000 |
parents | cb91bb07eeff |
children | 44b4e8bd759b |
comparison
equal
deleted
inserted
replaced
18683:dac3cb3627bd | 18771:6ecbb322a803 |
---|---|
520 | 520 |
521 return 0; | 521 return 0; |
522 } | 522 } |
523 | 523 |
524 /************************************************************************** | 524 /************************************************************************** |
525 * Notify signals callbacks | |
526 **************************************************************************/ | |
527 static void | |
528 notify_email_cb(char *subject, char *from, char *to, char *url) { | |
529 purple_debug_misc("signals test", "notify email: subject=%s, from=%s, to=%s, url=%s\n", | |
530 subject, from, to, url); | |
531 } | |
532 | |
533 static void | |
534 notify_emails_cb(char **subjects, char **froms, char **tos, char **urls, guint count) { | |
535 int i; | |
536 purple_debug_misc("signals test", "notify emails: count=%d\n", count); | |
537 for(i=0; i<count && i<5; i++) { | |
538 if(subjects[i]==NULL || froms[i]==NULL || tos[i]==NULL || urls[i]==NULL) continue; | |
539 purple_debug_misc("signals test", "notify emails[%d]: subject=%s, from=%s, to=%s, url=%s\n", | |
540 i, subjects[i], froms[i], tos[i], urls[i]); | |
541 } | |
542 } | |
543 | |
544 /************************************************************************** | |
525 * Plugin stuff | 545 * Plugin stuff |
526 **************************************************************************/ | 546 **************************************************************************/ |
527 static gboolean | 547 static gboolean |
528 plugin_load(PurplePlugin *plugin) | 548 plugin_load(PurplePlugin *plugin) |
529 { | 549 { |
533 void *conv_handle = purple_conversations_get_handle(); | 553 void *conv_handle = purple_conversations_get_handle(); |
534 void *accounts_handle = purple_accounts_get_handle(); | 554 void *accounts_handle = purple_accounts_get_handle(); |
535 void *ciphers_handle = purple_ciphers_get_handle(); | 555 void *ciphers_handle = purple_ciphers_get_handle(); |
536 void *ft_handle = purple_xfers_get_handle(); | 556 void *ft_handle = purple_xfers_get_handle(); |
537 void *sound_handle = purple_sounds_get_handle(); | 557 void *sound_handle = purple_sounds_get_handle(); |
558 void *notify_handle = purple_notify_get_handle(); | |
538 | 559 |
539 /* Accounts subsystem signals */ | 560 /* Accounts subsystem signals */ |
540 purple_signal_connect(accounts_handle, "account-connecting", | 561 purple_signal_connect(accounts_handle, "account-connecting", |
541 plugin, PURPLE_CALLBACK(account_connecting_cb), NULL); | 562 plugin, PURPLE_CALLBACK(account_connecting_cb), NULL); |
542 purple_signal_connect(accounts_handle, "account-setting-info", | 563 purple_signal_connect(accounts_handle, "account-setting-info", |
664 | 685 |
665 /* Sound signals */ | 686 /* Sound signals */ |
666 purple_signal_connect(sound_handle, "playing-sound-event", plugin, | 687 purple_signal_connect(sound_handle, "playing-sound-event", plugin, |
667 PURPLE_CALLBACK(sound_playing_event_cb), NULL); | 688 PURPLE_CALLBACK(sound_playing_event_cb), NULL); |
668 | 689 |
690 /* Notify signals */ | |
691 purple_signal_connect(notify_handle, "displaying-email-notification", | |
692 plugin, PURPLE_CALLBACK(notify_email_cb), NULL); | |
693 purple_signal_connect(notify_handle, "displaying-emails-notification", | |
694 plugin, PURPLE_CALLBACK(notify_emails_cb), NULL); | |
695 | |
669 return TRUE; | 696 return TRUE; |
670 } | 697 } |
671 | 698 |
672 static PurplePluginInfo info = | 699 static PurplePluginInfo info = |
673 { | 700 { |