From aada6d5cd6871847a79ccc932499aaf098f4e0fe Mon Sep 17 00:00:00 2001 From: James Booth Date: Sat, 25 Jan 2014 17:18:30 +0000 Subject: [PATCH] Don't show error for initial bookmarks request --- src/xmpp/bookmark.c | 5 +---- src/xmpp/connection.c | 13 +++++++++++-- 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/src/xmpp/bookmark.c b/src/xmpp/bookmark.c index 4516454f..726772a2 100644 --- a/src/xmpp/bookmark.c +++ b/src/xmpp/bookmark.c @@ -37,10 +37,7 @@ bookmark_request(void) xmpp_ctx_t *ctx = connection_get_ctx(); xmpp_stanza_t *iq; - id = get_unique_id(); - if (!id) { - return; - } + id = strdup("bookmark_init_request"); autojoin_count = 0; if (bookmark_ac != NULL) { diff --git a/src/xmpp/connection.c b/src/xmpp/connection.c index 2bf5a304..075321f7 100644 --- a/src/xmpp/connection.c +++ b/src/xmpp/connection.c @@ -345,8 +345,17 @@ connection_error_handler(xmpp_conn_t * const conn, xmpp_stanza_t * const stanza, gchar *err_msg = NULL; gchar *from = xmpp_stanza_get_attribute(stanza, STANZA_ATTR_FROM); xmpp_stanza_t *error_stanza = xmpp_stanza_get_child_by_name(stanza, STANZA_NAME_ERROR); - xmpp_stanza_t *text_stanza = - xmpp_stanza_get_child_by_name(error_stanza, STANZA_NAME_TEXT); + xmpp_stanza_t *text_stanza = xmpp_stanza_get_child_by_name(error_stanza, STANZA_NAME_TEXT); + + // handle specific errors by ID + char *id = xmpp_stanza_get_id(stanza); + if (id != NULL) { + + // ignore if server doesn't support bookmarks + if (strcmp("bookmark_init_request", id) == 0) { + return 1; + } + } if (error_stanza == NULL) { log_debug("error message without received");