Mercurial > ~mikael > mcabber > hg
comparison mcabber/src/jabglue.c @ 616:a61a257ec38b
MUC: display reason, if any, when a room has been destroyed
author | Mikael Berthe <mikael@lilotux.net> |
---|---|
date | Fri, 16 Dec 2005 12:09:46 +0100 |
parents | 789ec6aed764 |
children | d3a8b43bf9e7 |
comparison
equal
deleted
inserted
replaced
615:6f65b937fcf7 | 616:a61a257ec38b |
---|---|
1009 | 1009 |
1010 g_free(mbuf_end); | 1010 g_free(mbuf_end); |
1011 } else { | 1011 } else { |
1012 // Natural leave | 1012 // Natural leave |
1013 if (we_left) { | 1013 if (we_left) { |
1014 if (xmlnode_get_tag(xmldata, "destroy")) | 1014 xmlnode destroynode = xmlnode_get_tag(xmldata, "destroy"); |
1015 mbuf = g_strdup_printf("You have left %s, " | 1015 if (destroynode) { |
1016 "the room has been destroyed", roomjid); | 1016 gchar *rsn_noutf8 = NULL; |
1017 else | 1017 reason = from_utf8(xmlnode_get_tag_data(destroynode, "reason")); |
1018 if (reason) | |
1019 rsn_noutf8 = from_utf8(reason); | |
1020 if (rsn_noutf8) { | |
1021 mbuf = g_strdup_printf("You have left %s, " | |
1022 "the room has been destroyed: %s", | |
1023 roomjid, rsn_noutf8); | |
1024 g_free(rsn_noutf8); | |
1025 } else { | |
1026 mbuf = g_strdup_printf("You have left %s, " | |
1027 "the room has been destroyed", roomjid); | |
1028 } | |
1029 } else { | |
1018 mbuf = g_strdup_printf("You have left %s", roomjid); | 1030 mbuf = g_strdup_printf("You have left %s", roomjid); |
1031 } | |
1019 } else { | 1032 } else { |
1020 if (ustmsg) | 1033 if (ustmsg) |
1021 mbuf = g_strdup_printf("%s has left: %s", rname, ustmsg); | 1034 mbuf = g_strdup_printf("%s has left: %s", rname, ustmsg); |
1022 else | 1035 else |
1023 mbuf = g_strdup_printf("%s has left", rname); | 1036 mbuf = g_strdup_printf("%s has left", rname); |