comparison mcabber/src/roster.c @ 1444:3bf11085c6a5

New external "UNREAD" event (suggested by Viacheslav Chumushuk) Thanks to Viacheslav for the suggestion and sample patch.
author Mikael Berthe <mikael@lilotux.net>
date Sun, 02 Mar 2008 11:14:42 +0100
parents c5d937d5530b
children ef09de538e8f
comparison
equal deleted inserted replaced
1443:0623d694a77f 1444:3bf11085c6a5
21 21
22 #include <string.h> 22 #include <string.h>
23 23
24 #include "roster.h" 24 #include "roster.h"
25 #include "utils.h" 25 #include "utils.h"
26 #include "hooks.h"
26 27
27 extern void hlog_save_state(void); 28 extern void hlog_save_state(void);
28 29
29 char *strrole[] = { /* Should match enum in roster.h */ 30 char *strrole[] = { /* Should match enum in roster.h */
30 "none", 31 "none",
664 } 665 }
665 666
666 if (buddylist && (new_roster_item || !g_list_find(buddylist, roster_usr))) 667 if (buddylist && (new_roster_item || !g_list_find(buddylist, roster_usr)))
667 buddylist_build(); 668 buddylist_build();
668 669
669 if (unread_list_modified) 670 if (unread_list_modified) {
670 hlog_save_state(); 671 hlog_save_state();
672 guint unread_count = g_slist_length(unread_list);
673 /* Call external command */
674 hk_ext_cmd("", 'U', (guchar)MIN(255, unread_count), NULL);
675 }
671 } 676 }
672 677
673 const char *roster_getname(const char *jid) 678 const char *roster_getname(const char *jid)
674 { 679 {
675 GSList *sl_user; 680 GSList *sl_user;