mirror of
https://git.jabber.space/devs/cproof.git
synced 2026-07-18 16:36:20 +00:00
Add support for ad-hoc response with forms
This commit is contained in:
@@ -3899,11 +3899,11 @@ cmd_form(ProfWin *window, const char *const command, gchar **args)
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
if (g_strcmp0(args[0], "submit") == 0) {
|
||||
if (g_strcmp0(args[0], "submit") == 0 && confwin->submit != NULL) {
|
||||
confwin->submit(confwin);
|
||||
}
|
||||
|
||||
if (g_strcmp0(args[0], "cancel") == 0) {
|
||||
if (g_strcmp0(args[0], "cancel") == 0 && confwin->cancel != NULL) {
|
||||
confwin->cancel(confwin);
|
||||
}
|
||||
|
||||
|
||||
@@ -1176,6 +1176,12 @@ _command_exec_response_handler(xmpp_stanza_t *const stanza, void *const userdata
|
||||
const char *value = xmpp_stanza_get_text(note);
|
||||
win_handle_command_exec_result_note(win, type, value);
|
||||
}
|
||||
xmpp_stanza_t *x = xmpp_stanza_get_child_by_ns(cmd, STANZA_NS_DATA);
|
||||
if (x) {
|
||||
DataForm *form = form_create(x);
|
||||
ProfConfWin *confwin = (ProfConfWin*)wins_new_config(from, form, NULL, NULL, NULL);
|
||||
confwin_handle_configuration(confwin, form);
|
||||
}
|
||||
} else if (g_strcmp0(status, "executing") == 0) {
|
||||
win_handle_command_exec_status(win, command, "executing");
|
||||
|
||||
|
||||
Reference in New Issue
Block a user