Mercurial > hg
comparison mcabber/src/roster.c @ 889:ae93e69aaaaf
Fix up pending message flag for the status special buffer
It's still disabled (because it isn't useful as is).
author | Mikael Berthe <mikael@lilotux.net> |
---|---|
date | Tue, 30 May 2006 23:22:37 +0200 |
parents | afdd81c2c44d |
children | a07bd351008b |
comparison
equal
deleted
inserted
replaced
888:578d2034e971 | 889:ae93e69aaaaf |
---|---|
97 | 97 |
98 /* ### Initialization ### */ | 98 /* ### Initialization ### */ |
99 | 99 |
100 void roster_init(void) | 100 void roster_init(void) |
101 { | 101 { |
102 roster_special.name = "[status]"; | 102 roster_special.name = SPECIAL_BUFFER_STATUS_ID; |
103 roster_special.type = ROSTER_TYPE_SPECIAL; | 103 roster_special.type = ROSTER_TYPE_SPECIAL; |
104 } | 104 } |
105 | 105 |
106 /* ### Resources functions ### */ | 106 /* ### Resources functions ### */ |
107 | 107 |
526 | 526 |
527 // roster_msg_setflag() | 527 // roster_msg_setflag() |
528 // Set the ROSTER_FLAG_MSG to the given value for the given jid. | 528 // Set the ROSTER_FLAG_MSG to the given value for the given jid. |
529 // It will update the buddy's group message flag. | 529 // It will update the buddy's group message flag. |
530 // Update the unread messages list too. | 530 // Update the unread messages list too. |
531 void roster_msg_setflag(const char *jid, guint value) | 531 void roster_msg_setflag(const char *jid, guint special, guint value) |
532 { | 532 { |
533 GSList *sl_user; | 533 GSList *sl_user; |
534 roster *roster_usr, *roster_grp; | 534 roster *roster_usr, *roster_grp; |
535 int new_roster_item = FALSE; | 535 int new_roster_item = FALSE; |
536 | |
537 if (special) { | |
538 //sl_user = roster_find(jid, namesearch, ROSTER_TYPE_SPECIAL); | |
539 //if (!sl_user) return; | |
540 //roster_usr = (roster*)sl_user->data; | |
541 roster_usr = &roster_special; | |
542 if (value) { | |
543 roster_usr->flags |= ROSTER_FLAG_MSG; | |
544 // Append the roster_usr to unread_list, but avoid duplicates | |
545 if (!g_slist_find(unread_list, roster_usr)) | |
546 unread_list = g_slist_append(unread_list, roster_usr); | |
547 } else { | |
548 roster_usr->flags &= ~ROSTER_FLAG_MSG; | |
549 if (unread_list) { | |
550 GSList *node = g_slist_find(unread_list, roster_usr); | |
551 if (node) unread_list = g_slist_delete_link(unread_list, node); | |
552 } | |
553 } | |
554 return; | |
555 } | |
536 | 556 |
537 sl_user = roster_find(jid, jidsearch, | 557 sl_user = roster_find(jid, jidsearch, |
538 ROSTER_TYPE_USER|ROSTER_TYPE_ROOM|ROSTER_TYPE_AGENT); | 558 ROSTER_TYPE_USER|ROSTER_TYPE_ROOM|ROSTER_TYPE_AGENT); |
539 // If we can't find it, we add it | 559 // If we can't find it, we add it |
540 if (sl_user == NULL) { | 560 if (sl_user == NULL) { |