Mercurial > ~mikael > mcabber > hg
comparison mcabber/src/commands.c @ 1418:f69028ca6296
Update the group pending message flags when moving a contact to another group
author | Mikael Berthe <mikael@lilotux.net> |
---|---|
date | Wed, 23 Jan 2008 19:45:51 +0100 |
parents | 7f0da8de2a7d |
children | 3cd104b41f26 |
comparison
equal
deleted
inserted
replaced
1417:783b47c9d963 | 1418:f69028ca6296 |
---|---|
1814 | 1814 |
1815 strip_arg_special_chars(newgroupname); | 1815 strip_arg_special_chars(newgroupname); |
1816 | 1816 |
1817 group_utf8 = to_utf8(newgroupname); | 1817 group_utf8 = to_utf8(newgroupname); |
1818 if (strcmp(oldgroupname, group_utf8)) { | 1818 if (strcmp(oldgroupname, group_utf8)) { |
1819 guint msgflag; | |
1820 | |
1819 jb_updatebuddy(bjid, name, *group_utf8 ? group_utf8 : NULL); | 1821 jb_updatebuddy(bjid, name, *group_utf8 ? group_utf8 : NULL); |
1820 scr_RosterUp(); | 1822 scr_RosterUp(); |
1823 | |
1824 // If the buddy has a pending message flag, | |
1825 // we remove it temporarily in order to reset the global group | |
1826 // flag. We set it back once the buddy is in the new group, | |
1827 // which will update the new group's flag. | |
1828 msgflag = buddy_getflags(bud) & ROSTER_FLAG_MSG; | |
1829 if (msgflag) | |
1830 roster_msg_setflag(bjid, FALSE, FALSE); | |
1821 buddy_setgroup(bud, group_utf8); | 1831 buddy_setgroup(bud, group_utf8); |
1832 if (msgflag) | |
1833 roster_msg_setflag(bjid, FALSE, TRUE); | |
1822 } | 1834 } |
1823 | 1835 |
1824 g_free(group_utf8); | 1836 g_free(group_utf8); |
1825 g_free(newgroupname); | 1837 g_free(newgroupname); |
1826 update_roster = TRUE; | 1838 update_roster = TRUE; |