| 542 g_string_free(str, TRUE); |
542 g_string_free(str, TRUE); |
| 543 return FALSE; |
543 return FALSE; |
| 544 } |
544 } |
| 545 |
545 |
| 546 /************************************************************************** |
546 /************************************************************************** |
| 547 * Sound signal callbacks |
|
| 548 **************************************************************************/ |
|
| 549 static int |
|
| 550 sound_playing_event_cb(PurpleSoundEventID event, PurpleAccount *account) { |
|
| 551 if (account != NULL) |
|
| 552 purple_debug_misc("signals test", "sound playing event: %d for account: %s\n", |
|
| 553 event, purple_account_get_username(account)); |
|
| 554 else |
|
| 555 purple_debug_misc("signals test", "sound playing event: %d\n", event); |
|
| 556 |
|
| 557 return 0; |
|
| 558 } |
|
| 559 |
|
| 560 /************************************************************************** |
|
| 561 * Notify signals callbacks |
547 * Notify signals callbacks |
| 562 **************************************************************************/ |
548 **************************************************************************/ |
| 563 static void |
549 static void |
| 564 notify_email_cb(char *subject, char *from, char *to, char *url) { |
550 notify_email_cb(char *subject, char *from, char *to, char *url) { |
| 565 purple_debug_misc("signals test", "notify email: subject=%s, from=%s, to=%s, url=%s\n", |
551 purple_debug_misc("signals test", "notify email: subject=%s, from=%s, to=%s, url=%s\n", |
| 672 void *core_handle = purple_get_core(); |
658 void *core_handle = purple_get_core(); |
| 673 void *blist_handle = purple_blist_get_handle(); |
659 void *blist_handle = purple_blist_get_handle(); |
| 674 void *conn_handle = purple_connections_get_handle(); |
660 void *conn_handle = purple_connections_get_handle(); |
| 675 void *conv_handle = purple_conversations_get_handle(); |
661 void *conv_handle = purple_conversations_get_handle(); |
| 676 void *accounts_handle = purple_accounts_get_handle(); |
662 void *accounts_handle = purple_accounts_get_handle(); |
| 677 void *sound_handle = purple_sounds_get_handle(); |
|
| 678 void *notify_handle = purple_notify_get_handle(); |
663 void *notify_handle = purple_notify_get_handle(); |
| 679 void *jabber_handle = purple_protocols_find("prpl-jabber"); |
664 void *jabber_handle = purple_protocols_find("prpl-jabber"); |
| 680 |
665 |
| 681 /* Accounts subsystem signals */ |
666 /* Accounts subsystem signals */ |
| 682 purple_signal_connect(accounts_handle, "account-connecting", |
667 purple_signal_connect(accounts_handle, "account-connecting", |
| 788 purple_signal_connect(core_handle, "quitting", |
773 purple_signal_connect(core_handle, "quitting", |
| 789 plugin, PURPLE_CALLBACK(quitting_cb), NULL); |
774 plugin, PURPLE_CALLBACK(quitting_cb), NULL); |
| 790 purple_signal_connect(core_handle, "uri-handler", |
775 purple_signal_connect(core_handle, "uri-handler", |
| 791 plugin, PURPLE_CALLBACK(uri_handler), NULL); |
776 plugin, PURPLE_CALLBACK(uri_handler), NULL); |
| 792 |
777 |
| 793 /* Sound signals */ |
|
| 794 purple_signal_connect(sound_handle, "playing-sound-event", plugin, |
|
| 795 PURPLE_CALLBACK(sound_playing_event_cb), NULL); |
|
| 796 |
|
| 797 /* Notify signals */ |
778 /* Notify signals */ |
| 798 purple_signal_connect(notify_handle, "displaying-email-notification", |
779 purple_signal_connect(notify_handle, "displaying-email-notification", |
| 799 plugin, PURPLE_CALLBACK(notify_email_cb), NULL); |
780 plugin, PURPLE_CALLBACK(notify_email_cb), NULL); |
| 800 purple_signal_connect(notify_handle, "displaying-emails-notification", |
781 purple_signal_connect(notify_handle, "displaying-emails-notification", |
| 801 plugin, PURPLE_CALLBACK(notify_emails_cb), NULL); |
782 plugin, PURPLE_CALLBACK(notify_emails_cb), NULL); |