# HG changeset patch # User Mikael Berthe # Date 1233091442 -3600 # Node ID 72fef01d90613753a169b89fa42f3e5db5e3d737 # Parent 8e52ce94eee0fed9db4843584e177bcd9a1e374c# Parent bff9633e38ee8a17bccb4be26d9f8b348758035e Merge main and crew diff -r bff9633e38ee -r 72fef01d9061 mcabber/src/jab_iq.c --- 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");