diff 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
line wrap: on
line diff
--- a/mcabber/mcabber/hooks.c	Mon Mar 22 21:32:11 2010 +0100
+++ b/mcabber/mcabber/hooks.c	Mon Mar 22 21:47:22 2010 +0100
@@ -649,6 +649,30 @@
   g_free(cmdline);
 }
 
+void hk_unread_list_change(guint unread_count, guint attention_count,
+                           guint muc_unread, guint muc_attention)
+{
+#ifdef MODULES_ENABLE
+  gchar *str_unread = g_strdup_printf("%u", unread_count);
+  gchar *str_attention = g_strdup_printf("%u", attention_count);
+  gchar *str_muc_unread = g_strdup_printf("%u", muc_unread);
+  gchar *str_muc_attention = g_strdup_printf("%u", muc_attention);
+  hk_arg_t args[] = {
+    { "unread", str_unread },               // All unread
+    { "attention", str_attention },         // Attention (private)
+    { "muc_unread", str_muc_unread },       // MUC unread
+    { "muc_attention", str_muc_attention }, // MUC attention (highlight)
+    { NULL, NULL },
+  };
+  hk_run_handlers(HOOK_UNREAD_LIST_CHANGE, args);
+  g_free(str_unread);
+  g_free(str_attention);
+  g_free(str_muc_unread);
+  g_free(str_muc_attention);
+#endif
+}
+
+
 /* External commands */
 
 //  hk_ext_cmd_init()