diff options
author | Will Thompson <will.thompson@collabora.co.uk> | 2011-03-07 14:12:22 +0000 |
---|---|---|
committer | Will Thompson <will.thompson@collabora.co.uk> | 2011-05-03 13:15:26 +0100 |
commit | c1be75d93784a9b1b37b0dd717b1494029a675b8 (patch) | |
tree | 4574a9773e515c020b706865fe07290f223c048f /src/muc-channel.c | |
parent | ea21cdcd49ba24235f97060c056fe9cd9744e69e (diff) | |
download | telepathy-gabble-c1be75d93784a9b1b37b0dd717b1494029a675b8.tar.gz |
Remove GabbleXmppError.
There is a FIXME buried in here … but the tests pass.
Diffstat (limited to 'src/muc-channel.c')
-rw-r--r-- | src/muc-channel.c | 30 |
1 files changed, 10 insertions, 20 deletions
diff --git a/src/muc-channel.c b/src/muc-channel.c index f5bee8efa..a758399d2 100644 --- a/src/muc-channel.c +++ b/src/muc-channel.c @@ -42,7 +42,6 @@ #include "conn-aliasing.h" #include "debug.h" #include "disco.h" -#include "error.h" #include "message-util.h" #include "namespaces.h" #include "presence.h" @@ -2612,43 +2611,33 @@ _gabble_muc_channel_handle_subject (GabbleMucChannel *chan, const gchar *subject, LmMessage *msg) { - gboolean is_error; GabbleMucChannelPrivate *priv; TpIntSet *changed_values, *changed_flags; GValue val = { 0, }; + GError *error = NULL; g_assert (GABBLE_IS_MUC_CHANNEL (chan)); priv = chan->priv; - is_error = lm_message_get_sub_type (msg) == LM_MESSAGE_SUB_TYPE_ERROR; - if (priv->properties_ctx) { tp_properties_context_remove (priv->properties_ctx, ROOM_PROP_SUBJECT); } - if (is_error) + if (wocky_stanza_extract_errors (msg, NULL, &error, NULL, NULL)) { - WockyNode *node; - const gchar *err_desc = NULL; - - node = wocky_node_get_child ( - wocky_stanza_get_top_node (msg), "error"); - if (node) - { - GabbleXmppError xmpp_error = gabble_xmpp_error_from_node (node, - NULL); - err_desc = gabble_xmpp_error_description (xmpp_error); - } - if (priv->properties_ctx) { - GError *error = NULL; + error->domain = TP_ERRORS; + error->code = TP_ERROR_PERMISSION_DENIED; - error = g_error_new (TP_ERRORS, TP_ERROR_PERMISSION_DENIED, - "%s", (err_desc) ? err_desc : "failed to change subject"); + if (tp_str_empty (error->message)) + { + g_free (error->message); + error->message = g_strdup ("failed to change subject"); + } tp_properties_context_return (priv->properties_ctx, error); priv->properties_ctx = NULL; @@ -2657,6 +2646,7 @@ _gabble_muc_channel_handle_subject (GabbleMucChannel *chan, room_properties_update (chan); } + g_clear_error (&error); return; } |