Mercurial > pidgin
comparison libpurple/plugins/signals-test.c @ 18675:cb91bb07eeff
Email notification signals from charkins. Fixes #1324
author | Sean Egan <seanegan@gmail.com> |
---|---|
date | Sat, 28 Jul 2007 05:30:19 +0000 |
parents | d638845509fd |
children | 44b4e8bd759b |
comparison
equal
deleted
inserted
replaced
18674:7c8321023ae5 | 18675:cb91bb07eeff |
---|---|
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 { |