summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWill Thompson <will.thompson@collabora.co.uk>2013-02-15 08:39:36 +0000
committerWill Thompson <will.thompson@collabora.co.uk>2013-02-15 08:39:36 +0000
commitf842fbbb1c09cbb60c379006958f178e7f2d34aa (patch)
tree2e89b49bc3745a77d4731885d4f2d6f22991f59a
parente80923ff9fb329d39962e4fdb7ba800a1f2a2cb3 (diff)
muc-channel: pass full error into _receive
-rw-r--r--src/muc-channel.c19
1 files changed, 9 insertions, 10 deletions
diff --git a/src/muc-channel.c b/src/muc-channel.c
index c55771134..c0d142277 100644
--- a/src/muc-channel.c
+++ b/src/muc-channel.c
@@ -343,7 +343,8 @@ static void _gabble_muc_channel_handle_subject (GabbleMucChannel *chan,
static void _gabble_muc_channel_receive (GabbleMucChannel *chan,
TpChannelTextMessageType msg_type, TpHandleType handle_type,
TpHandle sender, GDateTime *datetime, const gchar *id, const gchar *text,
- WockyStanza *msg, TpChannelTextSendError send_error,
+ WockyStanza *msg,
+ const GError *send_error,
TpDeliveryStatus delivery_status);
static void
@@ -2808,7 +2809,8 @@ handle_message (GObject *source,
if (text != NULL)
_gabble_muc_channel_receive (gmuc,
msg_type, handle_type, from, datetime, xmpp_id, text, stanza,
- GABBLE_TEXT_CHANNEL_SEND_NO_ERROR, TP_DELIVERY_STATUS_DELIVERED);
+ NULL,
+ TP_DELIVERY_STATUS_DELIVERED);
if (from_member && state != WOCKY_MUC_MSG_STATE_NONE)
{
@@ -2856,7 +2858,6 @@ handle_errmsg (GObject *source,
TpBaseChannel *base = TP_BASE_CHANNEL (gmuc);
TpBaseConnection *conn = tp_base_channel_get_connection (base);
gboolean from_member = (who != NULL);
- TpChannelTextSendError tp_err = TP_CHANNEL_TEXT_SEND_ERROR_UNKNOWN;
TpDeliveryStatus ds = TP_DELIVERY_STATUS_DELIVERED;
TpHandleRepoIface *repo = NULL;
TpHandleType handle_type;
@@ -2884,8 +2885,6 @@ handle_errmsg (GObject *source,
from = tp_base_channel_get_target_handle (base);
}
- tp_err = gabble_tp_send_error_from_wocky_xmpp_error (error_code);
-
if (etype == WOCKY_XMPP_ERROR_TYPE_WAIT)
ds = TP_DELIVERY_STATUS_TEMPORARILY_FAILED;
else
@@ -2899,7 +2898,7 @@ handle_errmsg (GObject *source,
if (text != NULL)
_gabble_muc_channel_receive (gmuc, TP_CHANNEL_TEXT_MESSAGE_TYPE_NOTICE,
- handle_type, from, datetime, xmpp_id, text, stanza, tp_err, ds);
+ handle_type, from, datetime, xmpp_id, text, stanza, error, ds);
/* FIXME: this is stupid. WockyMuc gives us the subject for non-errors, but
* doesn't bother for errors.
@@ -2996,7 +2995,7 @@ _gabble_muc_channel_handle_subject (GabbleMucChannel *chan,
/**
* _gabble_muc_channel_receive: receive MUC messages
*/
-void
+static void
_gabble_muc_channel_receive (GabbleMucChannel *chan,
TpChannelTextMessageType msg_type,
TpHandleType sender_handle_type,
@@ -3005,7 +3004,7 @@ _gabble_muc_channel_receive (GabbleMucChannel *chan,
const gchar *id,
const gchar *text,
WockyStanza *msg,
- TpChannelTextSendError send_error,
+ const GError *send_error,
TpDeliveryStatus error_status)
{
TpBaseChannel *base;
@@ -3024,7 +3023,7 @@ _gabble_muc_channel_receive (GabbleMucChannel *chan,
muc_self_handle = chan->group.self_handle;
/* Is this an error report? */
- is_error = (send_error != GABBLE_TEXT_CHANNEL_SEND_NO_ERROR);
+ is_error = (send_error != NULL);
if (is_error && sender == muc_self_handle)
{
@@ -3102,7 +3101,7 @@ _gabble_muc_channel_receive (GabbleMucChannel *chan,
if (is_error)
tp_message_set_uint32 (delivery_report, 0, "delivery-error",
- send_error);
+ gabble_tp_send_error_from_wocky_xmpp_error (send_error->code));
/* We do not set a message-sender on the report: the intended recipient
* of the original message was the MUC, so the spec says we should omit