telepathy-glib: future-account: check we have AM, CM, and protocol in constructed
Jonny Lamb
jonny at kemper.freedesktop.org
Thu May 10 07:41:20 PDT 2012
Module: telepathy-glib
Branch: master
Commit: 09ece4e16b3a8b99d92a9f48610d92949edfa732
URL: http://cgit.freedesktop.org/telepathy/telepathy-glib/commit/?id=09ece4e16b3a8b99d92a9f48610d92949edfa732
Author: Jonny Lamb <jonny.lamb at collabora.co.uk>
Date: Mon May 7 13:50:10 2012 +0100
future-account: check we have AM, CM, and protocol in constructed
Signed-off-by: Jonny Lamb <jonny.lamb at collabora.co.uk>
---
telepathy-glib/future-account.c | 12 ++++++------
1 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/telepathy-glib/future-account.c b/telepathy-glib/future-account.c
index b8235e9..1082958 100644
--- a/telepathy-glib/future-account.c
+++ b/telepathy-glib/future-account.c
@@ -165,6 +165,10 @@ tp_future_account_constructed (GObject *object)
if (chain_up != NULL)
chain_up (object);
+ g_assert (priv->account_manager != NULL);
+ g_assert (priv->cm_name != NULL);
+ g_assert (priv->proto_name != NULL);
+
priv->parameters = g_hash_table_new_full (g_str_hash, g_str_equal,
g_free, (GDestroyNotify) tp_g_value_slice_free);
@@ -1151,16 +1155,12 @@ tp_future_account_create_account_async (TpFutureAccount *self,
return;
}
- if (priv->account_manager == NULL
- || priv->cm_name == NULL
- || priv->proto_name == NULL
- || priv->display_name == NULL)
+ if (priv->display_name == NULL)
{
g_simple_async_report_error_in_idle (G_OBJECT (self),
callback, user_data,
TP_ERROR, TP_ERROR_INVALID_ARGUMENT,
- "Future account is missing one or more of: account manager, "
- "connection manager name, protocol name, or display name");
+ "The future account needs a display name to create the account");
return;
}
More information about the telepathy-commits
mailing list