comparison mcabber/src/screen.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 578d2034e971
children 78f4971578dd
comparison
equal deleted inserted replaced
888:578d2034e971 889:ae93e69aaaaf
601 } 601 }
602 602
603 top_panel(win_entry->panel); 603 top_panel(win_entry->panel);
604 currentWindow = win_entry; 604 currentWindow = win_entry;
605 chatmode = TRUE; 605 chatmode = TRUE;
606 if (!special) { 606 if (!win_entry->lock)
607 if (!win_entry->lock) 607 roster_msg_setflag(winId, special, FALSE);
608 roster_msg_setflag(winId, FALSE); 608 if (!special)
609 roster_setflags(winId, ROSTER_FLAG_LOCK, TRUE); 609 roster_setflags(winId, ROSTER_FLAG_LOCK, TRUE);
610 }
611 update_roster = TRUE; 610 update_roster = TRUE;
612 611
613 // Refresh the window 612 // Refresh the window
614 scr_UpdateWindow(win_entry); 613 scr_UpdateWindow(win_entry);
615 614
734 doupdate(); 733 doupdate();
735 } else if (!(prefix_flags & HBB_PREFIX_NOFLAG)) { 734 } else if (!(prefix_flags & HBB_PREFIX_NOFLAG)) {
736 setmsgflg = TRUE; 735 setmsgflg = TRUE;
737 } 736 }
738 if (setmsgflg && !special) { 737 if (setmsgflg && !special) {
739 roster_msg_setflag(winId, TRUE); 738 if (special && !winId)
739 winId = SPECIAL_BUFFER_STATUS_ID;
740 roster_msg_setflag(winId, special, TRUE);
740 update_roster = TRUE; 741 update_roster = TRUE;
741 } 742 }
742 } 743 }
743 744
744 // scr_UpdateMainStatus() 745 // scr_UpdateMainStatus()
1429 // message from unread_list. 1430 // message from unread_list.
1430 void scr_RosterUnreadMessage(int next) 1431 void scr_RosterUnreadMessage(int next)
1431 { 1432 {
1432 gpointer unread_ptr; 1433 gpointer unread_ptr;
1433 gpointer refbuddata; 1434 gpointer refbuddata;
1434 gpointer ngroup;
1435 GList *nbuddy; 1435 GList *nbuddy;
1436 1436
1437 if (!current_buddy) return; 1437 if (!current_buddy) return;
1438 1438
1439 if (next) refbuddata = BUDDATA(current_buddy); 1439 if (next) refbuddata = BUDDATA(current_buddy);
1440 else refbuddata = NULL; 1440 else refbuddata = NULL;
1441 1441
1442 unread_ptr = unread_msg(refbuddata); 1442 unread_ptr = unread_msg(refbuddata);
1443 if (!unread_ptr) return; 1443 if (!unread_ptr) return;
1444 1444
1445 // If buddy is in a folded group, we need to expand it 1445 if (!(buddy_gettype(unread_ptr) & ROSTER_TYPE_SPECIAL)) {
1446 ngroup = buddy_getgroup(unread_ptr); 1446 gpointer ngroup;
1447 if (buddy_getflags(ngroup) & ROSTER_FLAG_HIDE) { 1447 // If buddy is in a folded group, we need to expand it
1448 buddy_setflags(ngroup, ROSTER_FLAG_HIDE, FALSE); 1448 ngroup = buddy_getgroup(unread_ptr);
1449 buddylist_build(); 1449 if (buddy_getflags(ngroup) & ROSTER_FLAG_HIDE) {
1450 buddy_setflags(ngroup, ROSTER_FLAG_HIDE, FALSE);
1451 buddylist_build();
1452 }
1450 } 1453 }
1451 1454
1452 nbuddy = g_list_find(buddylist, unread_ptr); 1455 nbuddy = g_list_find(buddylist, unread_ptr);
1453 if (nbuddy) { 1456 if (nbuddy) {
1454 set_current_buddy(nbuddy); 1457 set_current_buddy(nbuddy);
1769 // Set the message flag unless we're already in the jid buffer window 1772 // Set the message flag unless we're already in the jid buffer window
1770 void scr_setmsgflag_if_needed(const char *jid) 1773 void scr_setmsgflag_if_needed(const char *jid)
1771 { 1774 {
1772 const char *current_jid; 1775 const char *current_jid;
1773 bool iscurrentlocked = FALSE; 1776 bool iscurrentlocked = FALSE;
1777 guint isspe = FALSE;
1774 1778
1775 if (!jid) 1779 if (!jid)
1776 return; 1780 return;
1777 1781
1778 if (current_buddy) { 1782 if (current_buddy) {
1779 guint isspe;
1780 isspe = buddy_gettype(BUDDATA(current_buddy)) & ROSTER_TYPE_SPECIAL; 1783 isspe = buddy_gettype(BUDDATA(current_buddy)) & ROSTER_TYPE_SPECIAL;
1781 current_jid = buddy_getjid(BUDDATA(current_buddy)); 1784 current_jid = buddy_getjid(BUDDATA(current_buddy));
1782 if (current_jid) { 1785 if (current_jid) {
1783 winbuf *win_entry = scr_SearchWindow(current_jid, isspe); 1786 winbuf *win_entry = scr_SearchWindow(current_jid, isspe);
1784 if (!win_entry) return; 1787 if (!win_entry) return;
1786 } 1789 }
1787 } else { 1790 } else {
1788 current_jid = NULL; 1791 current_jid = NULL;
1789 } 1792 }
1790 if (!chatmode || !current_jid || strcmp(jid, current_jid) || iscurrentlocked) 1793 if (!chatmode || !current_jid || strcmp(jid, current_jid) || iscurrentlocked)
1791 roster_msg_setflag(jid, TRUE); 1794 roster_msg_setflag(jid, isspe, TRUE);
1792 } 1795 }
1793 1796
1794 // scr_set_multimode() 1797 // scr_set_multimode()
1795 // Public function to (un)set multimode... 1798 // Public function to (un)set multimode...
1796 // Convention: 1799 // Convention: