Mercurial > hg
comparison mcabber/src/screen.c @ 891:78f4971578dd
Add a "special" parameter to scr_setmsgflag_if_needed()
author | Mikael Berthe <mikael@lilotux.net> |
---|---|
date | Wed, 31 May 2006 23:12:56 +0200 |
parents | ae93e69aaaaf |
children | a05b5a16a06a |
comparison
equal
deleted
inserted
replaced
890:788e088702d6 | 891:78f4971578dd |
---|---|
1768 return multimode; | 1768 return multimode; |
1769 } | 1769 } |
1770 | 1770 |
1771 // scr_setmsgflag_if_needed(jid) | 1771 // scr_setmsgflag_if_needed(jid) |
1772 // 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 |
1773 void scr_setmsgflag_if_needed(const char *jid) | 1773 void scr_setmsgflag_if_needed(const char *jid, int special) |
1774 { | 1774 { |
1775 const char *current_jid; | 1775 const char *current_id; |
1776 bool iscurrentlocked = FALSE; | 1776 bool iscurrentlocked = FALSE; |
1777 guint isspe = FALSE; | |
1778 | 1777 |
1779 if (!jid) | 1778 if (!jid) |
1780 return; | 1779 return; |
1781 | 1780 |
1782 if (current_buddy) { | 1781 if (current_buddy) { |
1783 isspe = buddy_gettype(BUDDATA(current_buddy)) & ROSTER_TYPE_SPECIAL; | 1782 if (special) |
1784 current_jid = buddy_getjid(BUDDATA(current_buddy)); | 1783 current_id = buddy_getname(BUDDATA(current_buddy)); |
1785 if (current_jid) { | 1784 else |
1786 winbuf *win_entry = scr_SearchWindow(current_jid, isspe); | 1785 current_id = buddy_getjid(BUDDATA(current_buddy)); |
1786 if (current_id) { | |
1787 winbuf *win_entry = scr_SearchWindow(current_id, special); | |
1787 if (!win_entry) return; | 1788 if (!win_entry) return; |
1788 iscurrentlocked = win_entry->lock; | 1789 iscurrentlocked = win_entry->lock; |
1789 } | 1790 } |
1790 } else { | 1791 } else { |
1791 current_jid = NULL; | 1792 current_id = NULL; |
1792 } | 1793 } |
1793 if (!chatmode || !current_jid || strcmp(jid, current_jid) || iscurrentlocked) | 1794 if (!chatmode || !current_id || strcmp(jid, current_id) || iscurrentlocked) |
1794 roster_msg_setflag(jid, isspe, TRUE); | 1795 roster_msg_setflag(jid, special, TRUE); |
1795 } | 1796 } |
1796 | 1797 |
1797 // scr_set_multimode() | 1798 // scr_set_multimode() |
1798 // Public function to (un)set multimode... | 1799 // Public function to (un)set multimode... |
1799 // Convention: | 1800 // Convention: |