summaryrefslogtreecommitdiff
path: root/src/conn-olpc.c
diff options
context:
space:
mode:
authorWill Thompson <will.thompson@collabora.co.uk>2012-01-27 17:43:07 +0000
committerWill Thompson <will.thompson@collabora.co.uk>2012-01-27 22:15:59 +0000
commit3c0a4208c89e0f2fc2acbf2da8a4563386da7870 (patch)
tree995c47c130e1fa22136a2130b661a6bb1bfcf8c9 /src/conn-olpc.c
parentee42d5f8329229aa8b7ed34cc96b4b888f60f307 (diff)
downloadtelepathy-gabble-3c0a4208c89e0f2fc2acbf2da8a4563386da7870.tar.gz
Remove lm_message_get_[sub_]type.
Wocky is a little less convenient here, but wocky_stanza_extract_errors() comes to the rescue.
Diffstat (limited to 'src/conn-olpc.c')
-rw-r--r--src/conn-olpc.c14
1 files changed, 9 insertions, 5 deletions
diff --git a/src/conn-olpc.c b/src/conn-olpc.c
index ac50aaaa2..737d444ef 100644
--- a/src/conn-olpc.c
+++ b/src/conn-olpc.c
@@ -786,6 +786,7 @@ get_activities_reply_cb (GObject *source,
TpHandle from_handle;
TpHandleRepoIface *contact_repo = tp_base_connection_get_handles (
(TpBaseConnection *) ctx->conn, TP_HANDLE_TYPE_CONTACT);
+ GError *stanza_error = NULL;
reply_msg = wocky_pep_service_get_finish (WOCKY_PEP_SERVICE (source), res,
&err);
@@ -822,12 +823,15 @@ get_activities_reply_cb (GObject *source,
goto out;
}
- if (lm_message_get_sub_type (reply_msg) != LM_MESSAGE_SUB_TYPE_RESULT)
+ if (wocky_stanza_extract_errors (reply_msg, NULL, &stanza_error, NULL, NULL))
{
- GError error = { TP_ERRORS, TP_ERROR_NETWORK_ERROR,
- "Error in pubsub reply: server error" };
+ GError *tp_error = NULL;
- dbus_g_method_return_error (ctx->context, &error);
+ gabble_set_tp_error_from_wocky (stanza_error, &tp_error);
+ g_prefix_error (&tp_error, "Error in pubsub reply: ");
+ dbus_g_method_return_error (ctx->context, tp_error);
+ g_clear_error (&tp_error);
+ g_clear_error (&stanza_error);
goto out;
}
@@ -1310,7 +1314,7 @@ get_current_activity_reply_cb (GObject *source,
goto out;
}
- if (lm_message_get_sub_type (reply_msg) != LM_MESSAGE_SUB_TYPE_RESULT)
+ if (wocky_stanza_extract_errors (reply_msg, NULL, NULL, NULL, NULL))
{
DEBUG ("Failed to query PEP node. No current activity");