Mercurial > ~mikael > mcabber > hg
comparison mcabber/src/screen.c @ 1522:5ef122b2bb75
Use the status string of the most likely resource in the chat status bar
T. Glaser reported that mcabber can display the status string of a
resource with a low priority in the chat status bar. A string which
doesn't match the displayed status itself...
author | Mikael Berthe <mikael@lilotux.net> |
---|---|
date | Wed, 01 Oct 2008 19:09:59 +0200 |
parents | 33f8f795abd2 |
children | 3df441efb7c2 |
comparison
equal
deleted
inserted
replaced
1521:33f8f795abd2 | 1522:5ef122b2bb75 |
---|---|
1720 status = imstatus2char[budstate]; | 1720 status = imstatus2char[budstate]; |
1721 } | 1721 } |
1722 | 1722 |
1723 // No status message for MUC rooms | 1723 // No status message for MUC rooms |
1724 if (!ismuc) { | 1724 if (!ismuc) { |
1725 GSList *resources, *p_res; | 1725 GSList *resources, *p_res, *p_next_res; |
1726 resources = buddy_getresources(BUDDATA(current_buddy)); | 1726 resources = buddy_getresources(BUDDATA(current_buddy)); |
1727 msg = buddy_getstatusmsg(BUDDATA(current_buddy), | 1727 |
1728 resources ? resources->data : ""); | 1728 for (p_res = resources ; p_res ; p_res = p_next_res) { |
1729 // Free the resources list data | 1729 p_next_res = g_slist_next(p_res); |
1730 for (p_res = resources ; p_res ; p_res = g_slist_next(p_res)) | 1730 // Store the status message of the latest resource (highest priority) |
1731 if (!p_next_res) | |
1732 msg = buddy_getstatusmsg(BUDDATA(current_buddy), p_res->data); | |
1731 g_free(p_res->data); | 1733 g_free(p_res->data); |
1734 } | |
1732 g_slist_free(resources); | 1735 g_slist_free(resources); |
1733 } else { | 1736 } else { |
1734 msg = buddy_gettopic(BUDDATA(current_buddy)); | 1737 msg = buddy_gettopic(BUDDATA(current_buddy)); |
1735 } | 1738 } |
1736 | 1739 |