diff options
author | James Booth <boothj5@gmail.com> | 2014-09-17 21:48:55 +0100 |
---|---|---|
committer | James Booth <boothj5@gmail.com> | 2014-09-17 21:48:55 +0100 |
commit | d2a06ab18e75723bd93a5db57c9c29c5db875d7c (patch) | |
tree | 82fd5a8c86b706d0c6cd401b6bf4539e994bf5e5 /src/xmpp | |
parent | 672fcfe0090976814c066f7d926f77f90b3a3fdc (diff) | |
download | profani-tty-d2a06ab18e75723bd93a5db57c9c29c5db875d7c.tar.gz |
Handle result of room configuration submit
Diffstat (limited to 'src/xmpp')
-rw-r--r-- | src/xmpp/iq.c | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/src/xmpp/iq.c b/src/xmpp/iq.c index 62dfd64a..822e552d 100644 --- a/src/xmpp/iq.c +++ b/src/xmpp/iq.c @@ -666,14 +666,24 @@ _room_config_submit_handler(xmpp_conn_t * const conn, xmpp_stanza_t * const stan void * const userdata) { const char *id = xmpp_stanza_get_attribute(stanza, STANZA_ATTR_ID); + const char *type = xmpp_stanza_get_type(stanza); + const char *from = xmpp_stanza_get_attribute(stanza, STANZA_ATTR_FROM); if (id != NULL) { - log_debug("IQ room config handler fired, id: %s.", id); + log_debug("IQ room config submit handler fired, id: %s.", id); } else { - log_debug("IQ room config handler fired."); + log_debug("IQ room config submit handler fired."); + } + + // handle error responses + if (g_strcmp0(type, STANZA_TYPE_ERROR) == 0) { + char *error_message = stanza_get_error_message(stanza); + handle_room_config_submit_result_error(from, error_message); + free(error_message); + return 0; } - handle_room_config_submit_result(); + handle_room_config_submit_result(from); return 0; } |