summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>2014-02-21 16:42:47 +0100
committerGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>2014-02-21 17:20:36 +0100
commit009a7879e646a03fe385cd0a4f752d5a61b3590b (patch)
treeca5c6afb58e94158d672bb4ed15df1a1e410e31c
parente3ad134743120c99d630e4ab0992fb876cac741e (diff)
tp_base_connection_disconnect_with_dbus_error now takes a GVariant
-rw-r--r--src/auth-manager.c8
-rw-r--r--src/auth-manager.h2
-rw-r--r--src/connection.c10
-rw-r--r--src/server-sasl-channel.c7
-rw-r--r--src/server-sasl-channel.h2
-rw-r--r--src/server-tls-manager.c4
-rw-r--r--src/server-tls-manager.h2
7 files changed, 15 insertions, 20 deletions
diff --git a/src/auth-manager.c b/src/auth-manager.c
index a46d9937a..e0503e5a6 100644
--- a/src/auth-manager.c
+++ b/src/auth-manager.c
@@ -51,7 +51,7 @@ enum
typedef struct {
gchar *name;
- GHashTable *details;
+ GVariant *details;
TpConnectionStatusReason reason;
GError *wocky_error;
} SavedError;
@@ -176,7 +176,7 @@ gabble_auth_manager_finalize (GObject *object)
if (self->priv->error != NULL)
{
g_free (self->priv->error->name);
- g_hash_table_unref (self->priv->error->details);
+ g_variant_unref (self->priv->error->details);
g_slice_free (SavedError, self->priv->error);
}
@@ -667,7 +667,7 @@ channel_manager_iface_init (gpointer g_iface,
gboolean
gabble_auth_manager_get_failure_details (GabbleAuthManager *self,
gchar **dbus_error,
- GHashTable **details,
+ GVariant **details,
TpConnectionStatusReason *reason)
{
if (self->priv->channel != NULL)
@@ -681,7 +681,7 @@ gabble_auth_manager_get_failure_details (GabbleAuthManager *self,
*dbus_error = g_strdup (self->priv->error->name);
if (details != NULL)
- *details = g_hash_table_ref (self->priv->error->details);
+ *details = g_variant_ref (self->priv->error->details);
if (reason != NULL)
*reason = self->priv->error->reason;
diff --git a/src/auth-manager.h b/src/auth-manager.h
index dad5115f9..c05a5bbb0 100644
--- a/src/auth-manager.h
+++ b/src/auth-manager.h
@@ -60,7 +60,7 @@ GType gabble_auth_manager_get_type (void);
GabbleAuthManagerClass))
gboolean gabble_auth_manager_get_failure_details (GabbleAuthManager *self,
- gchar **dbus_error, GHashTable **details,
+ gchar **dbus_error, GVariant **details,
TpConnectionStatusReason *reason);
G_END_DECLS
diff --git a/src/connection.c b/src/connection.c
index 5207ed611..5c052f005 100644
--- a/src/connection.c
+++ b/src/connection.c
@@ -1588,14 +1588,12 @@ gabble_connection_disconnect_with_tp_error (GabbleConnection *self,
TpConnectionStatusReason reason)
{
TpBaseConnection *base = (TpBaseConnection *) self;
- GHashTable *details = tp_asv_new (
- "debug-message", G_TYPE_STRING, tp_error->message,
- NULL);
+ GVariant *details = g_variant_new_parsed (
+ "{ 'debug-message': <%s> }", tp_error->message);
g_assert (tp_error->domain == TP_ERROR);
tp_base_connection_disconnect_with_dbus_error (base,
tp_error_get_dbus_name (tp_error->code), details, reason);
- g_hash_table_unref (details);
}
static void
@@ -1678,7 +1676,7 @@ connector_error_disconnect (GabbleConnection *self,
TpBaseConnection *base = (TpBaseConnection *) self;
TpConnectionStatusReason reason = TP_CONNECTION_STATUS_REASON_NETWORK_ERROR;
gchar *dbus_error = NULL;
- GHashTable *details = NULL;
+ GVariant *details = NULL;
if (error->domain == GABBLE_SERVER_TLS_ERROR)
{
@@ -1692,7 +1690,6 @@ connector_error_disconnect (GabbleConnection *self,
tp_base_connection_disconnect_with_dbus_error (base, dbus_error,
details, reason);
- tp_clear_pointer (&details, g_hash_table_unref);
g_free (dbus_error);
return;
@@ -1708,7 +1705,6 @@ connector_error_disconnect (GabbleConnection *self,
tp_base_connection_disconnect_with_dbus_error (base, dbus_error,
details, reason);
- tp_clear_pointer (&details, g_hash_table_unref);
g_free (dbus_error);
return;
}
diff --git a/src/server-sasl-channel.c b/src/server-sasl-channel.c
index aae40ee57..d6f68fff8 100644
--- a/src/server-sasl-channel.c
+++ b/src/server-sasl-channel.c
@@ -1030,8 +1030,7 @@ gabble_server_sasl_channel_close (TpBaseChannel *channel)
/**
* @dbus_error: (out) (transfer full): the D-Bus error name
- * @details: (out) (transfer full) (element-type utf8 GObject.Value): the
- * error details
+ * @details: (out) (transfer full): the error details
* @reason: (out): the reason with which to disconnect
* @error: (out): an error in a domain Wocky understands describing what went
* wrong
@@ -1042,7 +1041,7 @@ gabble_server_sasl_channel_close (TpBaseChannel *channel)
gboolean
gabble_server_sasl_channel_get_failure_details (GabbleServerSaslChannel *self,
gchar **dbus_error,
- GHashTable **details,
+ GVariant **details,
TpConnectionStatusReason *reason,
GError **error)
{
@@ -1052,7 +1051,7 @@ gabble_server_sasl_channel_get_failure_details (GabbleServerSaslChannel *self,
*dbus_error = g_strdup (self->priv->sasl_error);
if (details != NULL)
- *details = g_hash_table_ref (self->priv->sasl_error_details);
+ *details = tp_asv_to_vardict (self->priv->sasl_error_details);
if (reason != NULL)
*reason = self->priv->disconnect_reason;
diff --git a/src/server-sasl-channel.h b/src/server-sasl-channel.h
index 83e41bd56..e6543267a 100644
--- a/src/server-sasl-channel.h
+++ b/src/server-sasl-channel.h
@@ -93,7 +93,7 @@ void gabble_server_sasl_channel_fail (GabbleServerSaslChannel *self,
const GError *error);
gboolean gabble_server_sasl_channel_get_failure_details (
- GabbleServerSaslChannel *self, gchar **dbus_error, GHashTable **details,
+ GabbleServerSaslChannel *self, gchar **dbus_error, GVariant **details,
TpConnectionStatusReason *reason,
GError **error);
diff --git a/src/server-tls-manager.c b/src/server-tls-manager.c
index 92f7d1b15..7cfb68f8d 100644
--- a/src/server-tls-manager.c
+++ b/src/server-tls-manager.c
@@ -549,7 +549,7 @@ cert_reject_reason_to_conn_reason (TpTLSCertificateRejectReason tls_reason)
void
gabble_server_tls_manager_get_rejection_details (GabbleServerTLSManager *self,
gchar **dbus_error,
- GHashTable **details,
+ GVariant **details,
TpConnectionStatusReason *reason)
{
GabbleTLSCertificate *certificate;
@@ -581,7 +581,7 @@ gabble_server_tls_manager_get_rejection_details (GabbleServerTLSManager *self,
&details_tmp);
*dbus_error = g_strdup (dbus_error_tmp);
- *details = g_boxed_copy (TP_HASH_TYPE_STRING_VARIANT_MAP, details_tmp);
+ *details = tp_asv_to_vardict (details_tmp);
*reason = cert_reject_reason_to_conn_reason (tls_reason);
diff --git a/src/server-tls-manager.h b/src/server-tls-manager.h
index 816866b5e..4043704f9 100644
--- a/src/server-tls-manager.h
+++ b/src/server-tls-manager.h
@@ -66,7 +66,7 @@ GQuark gabble_server_tls_error_quark (void);
void gabble_server_tls_manager_get_rejection_details (
GabbleServerTLSManager *self,
gchar **dbus_error,
- GHashTable **details,
+ GVariant **details,
TpConnectionStatusReason *reason);
G_END_DECLS