diff options
author | Will Thompson <will.thompson@collabora.co.uk> | 2013-02-20 09:15:04 +0000 |
---|---|---|
committer | Will Thompson <will.thompson@collabora.co.uk> | 2013-02-22 00:24:04 +0000 |
commit | 21b752bf71edc6889161dca905c3c8300c254355 (patch) | |
tree | 2fc40cb1f3bfdc4bfc20cfe8df5fafd02e3a3d46 | |
parent | 8f315a9dc0e575375a8e592bf84591bdec64afc0 (diff) |
Update Wocky snapshot
The improvements are:
* A new error code, WOCKY_XMPP_ERROR_POLICY_VIOLATION, added in RFC 6120
and used by Prosody's MUC rate-limiting;
* Fixes to the error parsing code when error conditions are not
recognised;
* Tweaks to WockyMuc's error signals to include the full GError and
WockyXmppErrorType in both.
m--------- | lib/ext/wocky | 0 | ||||
-rw-r--r-- | src/muc-channel.c | 27 |
2 files changed, 9 insertions, 18 deletions
diff --git a/lib/ext/wocky b/lib/ext/wocky -Subproject a38dbe13ebf4eef59fbd1a868464987e204ea60 +Subproject 0fc8f511683054634d7ba5d447e38a634400eeb diff --git a/src/muc-channel.c b/src/muc-channel.c index 149dcd5a0..47ab9d5b9 100644 --- a/src/muc-channel.c +++ b/src/muc-channel.c @@ -272,8 +272,8 @@ static void handle_renamed (GObject *source, static void handle_error (GObject *source, WockyStanza *stanza, - WockyXmppError errnum, - const gchar *message, + WockyXmppErrorType errtype, + const GError *error, gpointer data); static void handle_join (WockyMuc *muc, @@ -330,8 +330,8 @@ static void handle_errmsg (GObject *source, GDateTime *datetime, WockyMucMember *who, const gchar *text, - WockyXmppError error, WockyXmppErrorType etype, + const GError *error, gpointer data); /* Signatures for some other stuff. */ @@ -1883,8 +1883,8 @@ update_permissions (GabbleMucChannel *chan) static void handle_error (GObject *source, WockyStanza *stanza, - WockyXmppError errnum, - const gchar *message, + WockyXmppErrorType errtype, + const GError *error, gpointer data) { GabbleMucChannel *gmuc = GABBLE_MUC_CHANNEL (data); @@ -1899,7 +1899,7 @@ handle_error (GObject *source, return; } - if (errnum == WOCKY_XMPP_ERROR_NOT_AUTHORIZED) + if (error->code == WOCKY_XMPP_ERROR_NOT_AUTHORIZED) { /* channel can sit requiring a password indefinitely */ clear_join_timer (gmuc); @@ -1919,7 +1919,7 @@ handle_error (GObject *source, { GError *tp_error = NULL; - switch (errnum) + switch (error->code) { case WOCKY_XMPP_ERROR_FORBIDDEN: tp_error = g_error_new (TP_ERROR, TP_ERROR_CHANNEL_BANNED, @@ -1944,7 +1944,7 @@ handle_error (GObject *source, default: tp_error = g_error_new (TP_ERROR, TP_ERROR_NOT_AVAILABLE, - "%s", wocky_xmpp_error_description (errnum)); + "%s", wocky_xmpp_error_description (error->code)); break; } @@ -2849,8 +2849,8 @@ handle_errmsg (GObject *source, GDateTime *datetime, WockyMucMember *who, const gchar *text, - WockyXmppError error_code, WockyXmppErrorType etype, + const GError *error, gpointer data) { GabbleMucChannel *gmuc = GABBLE_MUC_CHANNEL (data); @@ -2863,7 +2863,6 @@ handle_errmsg (GObject *source, TpHandleType handle_type; TpHandle from = 0; const gchar *subject; - GError *error = NULL; if (from_member) { @@ -2890,12 +2889,6 @@ handle_errmsg (GObject *source, else ds = TP_DELIVERY_STATUS_PERMANENTLY_FAILED; - /* FIXME: this is also stupid. Wocky should give us the whole GError, or - * nothing. - */ - if (!wocky_stanza_extract_errors (stanza, NULL, &error, NULL, NULL)) - g_return_if_reached(); - if (text != NULL) _gabble_muc_channel_receive (gmuc, TP_CHANNEL_TEXT_MESSAGE_TYPE_NOTICE, handle_type, from, datetime, xmpp_id, text, stanza, error, ds); @@ -2915,8 +2908,6 @@ handle_errmsg (GObject *source, !tp_strdiff (xmpp_id, priv->set_subject_stanza_id))) _gabble_muc_channel_handle_subject (gmuc, handle_type, from, datetime, subject, stanza, error); - - g_clear_error (&error); } /* ************************************************************************* */ |