comparison mcabber/mcabber/hooks.c @ 1812:5dbb3ebbc466

Add hk_unread_list_change() (Suggested by isbear)
author Mikael Berthe <mikael@lilotux.net>
date Mon, 22 Mar 2010 21:47:22 +0100
parents e6d355e50d7a
children 1c3efa9bc422
comparison
equal deleted inserted replaced
1811:e6d355e50d7a 1812:5dbb3ebbc466
647 mcabber_set_terminate_ui(); 647 mcabber_set_terminate_ui();
648 648
649 g_free(cmdline); 649 g_free(cmdline);
650 } 650 }
651 651
652 void hk_unread_list_change(guint unread_count, guint attention_count,
653 guint muc_unread, guint muc_attention)
654 {
655 #ifdef MODULES_ENABLE
656 gchar *str_unread = g_strdup_printf("%u", unread_count);
657 gchar *str_attention = g_strdup_printf("%u", attention_count);
658 gchar *str_muc_unread = g_strdup_printf("%u", muc_unread);
659 gchar *str_muc_attention = g_strdup_printf("%u", muc_attention);
660 hk_arg_t args[] = {
661 { "unread", str_unread }, // All unread
662 { "attention", str_attention }, // Attention (private)
663 { "muc_unread", str_muc_unread }, // MUC unread
664 { "muc_attention", str_muc_attention }, // MUC attention (highlight)
665 { NULL, NULL },
666 };
667 hk_run_handlers(HOOK_UNREAD_LIST_CHANGE, args);
668 g_free(str_unread);
669 g_free(str_attention);
670 g_free(str_muc_unread);
671 g_free(str_muc_attention);
672 #endif
673 }
674
675
652 /* External commands */ 676 /* External commands */
653 677
654 // hk_ext_cmd_init() 678 // hk_ext_cmd_init()
655 // Initialize external command variable. 679 // Initialize external command variable.
656 // Can be called with parameter NULL to reset and free memory. 680 // Can be called with parameter NULL to reset and free memory.