Mercurial > ~mikael > mcabber > hg
changeset 1576:72fef01d9061
Merge main and crew
author | Mikael Berthe <mikael@lilotux.net> |
---|---|
date | Tue, 27 Jan 2009 22:24:02 +0100 |
parents | 8e52ce94eee0 (diff) bff9633e38ee (current diff) |
children | e1a642472f4e |
files | |
diffstat | 1 files changed, 15 insertions(+), 13 deletions(-) [+] |
line wrap: on
line diff
--- a/mcabber/src/jab_iq.c Tue Jan 27 22:19:04 2009 +0100 +++ b/mcabber/src/jab_iq.c Tue Jan 27 22:24:02 2009 +0100 @@ -1190,10 +1190,10 @@ // I do not think this is useful, user should not have to care of the // priority like gossip and gajim do (misc) y = xmlnode_insert_tag(x, "field"); - xmlnode_put_attrib(y, "type", "text-multi"); + xmlnode_put_attrib(y, "type", "text-single"); xmlnode_put_attrib(y, "var", "status-message"); xmlnode_put_attrib(y, "label", "Message"); - } else if (!strcmp(action, "cancel")) { + } else if (action && !strcmp(action, "cancel")) { xmlnode_put_attrib(command, "status", "canceled"); } else { // (if sessionid and not canceled) y = xmlnode_get_tag(x, "x?xmlns=jabber:x:data"); @@ -1203,16 +1203,18 @@ "value"); message = xmlnode_get_tag_data(xmlnode_get_tag(y, "field?var=status-message"), "value"); - for (s = adhoc_status_list; !s->name || strcmp(s->name, value); s++); - if (s->name) { - char *status = g_strdup_printf("%s %s", s->status, - message ? message : ""); - cmd_setstatus(NULL, status); - g_free(status); - xmlnode_put_attrib(command, "status", "completed"); - xmlnode_put_attrib(iq, "type", "result"); - xmlnode_insert_dataform_result_message(command, - "Status has been changed"); + if (value) { + for (s = adhoc_status_list; s->name && strcmp(s->name, value); s++); + if (s->name) { + char *status = g_strdup_printf("%s %s", s->status, + message ? message : ""); + cmd_setstatus(NULL, status); + g_free(status); + xmlnode_put_attrib(command, "status", "completed"); + xmlnode_put_attrib(iq, "type", "result"); + xmlnode_insert_dataform_result_message(command, + "Status has been changed"); + } } } } @@ -1295,7 +1297,7 @@ xmlnode_insert_tag(field, "required"); foreach_buddy(ROSTER_TYPE_ROOM, &_callback_foreach_buddy_groupchat, &field); - } else if (!strcmp(action, "cancel")) { + } else if (action && !strcmp(action, "cancel")) { xmlnode_put_attrib(command, "status", "canceled"); } else { // (if sessionid and not canceled) xmlnode form = xmlnode_get_tag(x, "x?xmlns=jabber:x:data");