summaryrefslogtreecommitdiff
path: root/telepathy-glib/base-connection-manager.c
diff options
context:
space:
mode:
authorSimon McVittie <simon.mcvittie@collabora.co.uk>2010-03-08 17:00:54 +0000
committerAndre Moreira Magalhaes (andrunko) <andre.magalhaes@collabora.co.uk>2010-06-29 20:30:38 -0300
commit3f39b55aa5193a2f9b411899c4d6314aaddadd2c (patch)
tree4d8dad2442dde92c8a034dc22e43553ec387d96c /telepathy-glib/base-connection-manager.c
parent776535c409736fa4021cc045e3fb1628b18f18bc (diff)
downloadtelepathy-glib-3f39b55aa5193a2f9b411899c4d6314aaddadd2c.tar.gz
_TpLegacyProtocol: remove filtering/sanity-checking which is now done more generally
Diffstat (limited to 'telepathy-glib/base-connection-manager.c')
-rw-r--r--telepathy-glib/base-connection-manager.c67
1 files changed, 1 insertions, 66 deletions
diff --git a/telepathy-glib/base-connection-manager.c b/telepathy-glib/base-connection-manager.c
index 3db236293..a941a47f6 100644
--- a/telepathy-glib/base-connection-manager.c
+++ b/telepathy-glib/base-connection-manager.c
@@ -728,33 +728,11 @@ set_param_from_value (const TpCMParamSpec *paramspec,
return FALSE;
}
- if (paramspec->filter != NULL)
- {
- if (!(paramspec->filter) (paramspec, value, error))
- {
- DEBUG ("parameter %s rejected by filter function: %s",
- paramspec->name, error ? (*error)->message : "(error ignored)");
- return FALSE;
- }
-
- /* the filter may not change the type of the GValue */
- g_return_val_if_fail (G_VALUE_TYPE (value) == paramspec->gtype, FALSE);
- }
-
set_param (paramspec, value, params);
return TRUE;
}
-static void
-report_unknown_param (gpointer key, gpointer value, gpointer user_data)
-{
- const char *arg = (const char *) key;
- GString **error_str = (GString **) user_data;
- *error_str = g_string_append_c (*error_str, ' ');
- *error_str = g_string_append (*error_str, arg);
-}
-
static gboolean
parse_parameters (const TpCMParamSpec *paramspec,
GHashTable *provided,
@@ -764,41 +742,13 @@ parse_parameters (const TpCMParamSpec *paramspec,
GError **error)
{
int i;
- guint mandatory_flag = TP_CONN_MGR_PARAM_FLAG_REQUIRED;
GValue *value;
- value = g_hash_table_lookup (provided, "register");
- if (value != NULL && G_VALUE_TYPE(value) == G_TYPE_BOOLEAN &&
- g_value_get_boolean (value))
- {
- mandatory_flag = TP_CONN_MGR_PARAM_FLAG_REGISTER;
- }
-
for (i = 0; paramspec[i].name; i++)
{
value = g_hash_table_lookup (provided, paramspec[i].name);
- if (value == NULL)
- {
- if (paramspec[i].flags & mandatory_flag)
- {
- DEBUG ("missing mandatory param %s", paramspec[i].name);
- g_set_error (error, TP_ERRORS, TP_ERROR_INVALID_ARGUMENT,
- "missing mandatory account parameter %s", paramspec[i].name);
- return FALSE;
- }
- else if (paramspec[i].flags & TP_CONN_MGR_PARAM_FLAG_HAS_DEFAULT)
- {
- _tp_cm_param_spec_set_default (&paramspec[i], set_param, params);
- tp_intset_add (params_present, i);
- }
- else
- {
- DEBUG ("%s not given, using default behaviour",
- paramspec[i].name);
- }
- }
- else
+ if (value != NULL)
{
if (!set_param_from_value (&paramspec[i], value, set_param, params,
error))
@@ -812,21 +762,6 @@ parse_parameters (const TpCMParamSpec *paramspec,
}
}
- if (g_hash_table_size (provided) != 0)
- {
- gchar *error_txt;
- GString *error_str = g_string_new ("unknown parameters provided:");
-
- g_hash_table_foreach (provided, report_unknown_param, &error_str);
- error_txt = g_string_free (error_str, FALSE);
-
- DEBUG ("%s", error_txt);
- g_set_error (error, TP_ERRORS, TP_ERROR_INVALID_ARGUMENT,
- "%s", error_txt);
- g_free (error_txt);
- return FALSE;
- }
-
return TRUE;
}