From 8a078b97403483f8bd3582ccbb19738f311b9826 Mon Sep 17 00:00:00 2001 From: Simon McVittie Date: Mon, 14 Oct 2013 17:59:25 +0100 Subject: [PATCH] Remove the A.I.Hidden, AM.I.Hidden interfaces They haven't been undrafted since they were added 2.5 years ago, and Will described them as "a bit sketchy" back then... which doesn't seem particularly compatible with consolidating and simplifying for 1.0. It's not clear to me that Telepathy is particularly appropriate for "non-user-facing" accounts. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=33101 --- configure.ac | 14 ---- src/Makefile.am | 20 ------ src/mcd-account-config.h | 2 +- src/mcd-account-manager-priv.h | 3 - src/mcd-account-manager.c | 77 +++------------------- src/mcd-account-priv.h | 3 - src/mcd-account.c | 90 ------------------------- src/mcd-storage-ag-hidden.c | 99 ---------------------------- src/mcd-storage-ag-hidden.h | 59 ----------------- src/mcd-storage.c | 7 -- src/mcd.xml | 3 - tests/twisted/Makefile.am | 1 - tests/twisted/account-manager/hidden.py | 110 ------------------------------- tests/twisted/constants.py | 2 - tests/twisted/mctest.py | 12 +--- xml/Account_Interface_Hidden.xml | 65 ------------------ xml/Account_Manager_Interface_Hidden.xml | 100 ---------------------------- xml/Makefile.am | 2 - xml/nmc5.xml | 2 - 19 files changed, 12 insertions(+), 659 deletions(-) delete mode 100644 src/mcd-storage-ag-hidden.c delete mode 100644 src/mcd-storage-ag-hidden.h delete mode 100644 tests/twisted/account-manager/hidden.py delete mode 100644 xml/Account_Interface_Hidden.xml delete mode 100644 xml/Account_Manager_Interface_Hidden.xml diff --git a/configure.ac b/configure.ac index c5b945c..fc78f6a 100644 --- a/configure.ac +++ b/configure.ac @@ -207,19 +207,6 @@ dnl the automake conditional AM_CONDITIONAL(ENABLE_LIBACCOUNTS_SSO, [test x$libaccounts_sso_enabled = xyes]) dnl /libaccounts-glib SSO -AC_ARG_WITH([accounts-glib-hidden-service-type], - [AS_HELP_STRING([--with-accounts-glib-hidden-service-type], - [mark accounts with the provided service type as hidden @<:@default=no@:>@])], - [], - [with_accounts_glib_hidden_service_type=no]) -AS_IF([ test "x$with_accounts_glib_hidden_service_type" != xno ], - [AC_DEFINE_UNQUOTED(ACCOUNTS_GLIB_HIDDEN_SERVICE_TYPE, - ["$with_accounts_glib_hidden_service_type"], - [Defined to the non-IM service type for hidden accounts, if any])]) - -AM_CONDITIONAL(ENABLE_LIBACCOUNTS_GLIB_HIDDEN, - [test x$with_accounts_glib_hidden_service_type != xno]) - PKG_CHECK_MODULES(DBUS, [dbus-1 >= 0.95, dbus-glib-1 >= 0.82]) AC_SUBST(DBUS_CFLAGS) AC_SUBST(DBUS_LIBS) @@ -380,6 +367,5 @@ Configure summary: Suspend tracking with UPower.: ${have_upower} Aegis........................: ${aegis_enabled} libaccounts-glib backend.....: ${libaccounts_sso_enabled} - Hidden accounts-glib accounts: ${with_accounts_glib_hidden_service_type} Nokia Mode Control Entity....: ${HAVE_MCE} " diff --git a/src/Makefile.am b/src/Makefile.am index d49295d..b8835a6 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -31,13 +31,6 @@ if ENABLE_LIBACCOUNTS_SSO mc_headers += \ mcd-account-manager-sso.h \ $(NULL) - -if ENABLE_LIBACCOUNTS_GLIB_HIDDEN -mc_headers += \ - mcd-storage-ag-hidden.h \ - $(NULL) -endif - endif mc_gen_headers = \ @@ -46,8 +39,6 @@ mc_gen_headers = \ _gen/gtypes.h \ _gen/interfaces.h \ _gen/svc-Account_Interface_External_Password_Storage.h \ - _gen/svc-Account_Interface_Hidden.h \ - _gen/svc-Account_Manager_Interface_Hidden.h \ _gen/svc-dispatcher.h nodist_libmcd_convenience_la_SOURCES = \ @@ -59,8 +50,6 @@ nodist_libmcd_convenience_la_SOURCES = \ _gen/signals-marshal.h \ _gen/signals-marshal.list \ _gen/svc-Account_Interface_External_Password_Storage.c \ - _gen/svc-Account_Interface_Hidden.c \ - _gen/svc-Account_Manager_Interface_Hidden.c \ _gen/svc-dispatcher.c \ mcd-enum-types.c \ mcd-enum-types.h \ @@ -75,9 +64,7 @@ CLEANFILES = \ $(BUILT_SOURCES) \ _gen/cli-Connection_Manager_Interface_Account_Storage-gtk-doc.h \ _gen/svc-dispatcher-gtk-doc.h \ - _gen/svc-Account_Interface_Hidden-gtk-doc.h \ _gen/svc-Account_Interface_External_Password_Storage-gtk-doc.h \ - _gen/svc-Account_Manager_Interface_Hidden-gtk-doc.h \ _gen/gtypes-gtk-doc.h \ $(NULL) @@ -165,13 +152,6 @@ if ENABLE_LIBACCOUNTS_SSO libmcd_convenience_la_SOURCES += \ mcd-account-manager-sso.c \ $(NULL) - -if ENABLE_LIBACCOUNTS_GLIB_HIDDEN -libmcd_convenience_la_SOURCES += \ - mcd-storage-ag-hidden.c \ - $(NULL) -endif - endif mcd-enum-types.h: stamp-mcd-enum-types.h diff --git a/src/mcd-account-config.h b/src/mcd-account-config.h index c692e0e..8abfbb8 100644 --- a/src/mcd-account-config.h +++ b/src/mcd-account-config.h @@ -56,7 +56,6 @@ #define MC_ACCOUNTS_KEY_CONNECT_AUTOMATICALLY "ConnectAutomatically" #define MC_ACCOUNTS_KEY_ENABLED "Enabled" #define MC_ACCOUNTS_KEY_HAS_BEEN_ONLINE "HasBeenOnline" -#define MC_ACCOUNTS_KEY_HIDDEN "Hidden" /* string array, 'as' */ #define MC_ACCOUNTS_KEY_URI_SCHEMES \ @@ -73,6 +72,7 @@ #define MC_OLD_ACCOUNTS_KEY_DATA_DIR "data_dir" #define MC_OLD_ACCOUNTS_KEY_DELETED "deleted" #define MC_OLD_ACCOUNTS_KEY_GROUPS "groups" +#define MC_OLD_ACCOUNTS_KEY_HIDDEN "Hidden" #define MC_OLD_ACCOUNTS_KEY_ICON_NAME "icon_name" #define MC_OLD_ACCOUNTS_KEY_PRESETS "presets" #define MC_OLD_ACCOUNTS_KEY_PROFILE "profile" diff --git a/src/mcd-account-manager-priv.h b/src/mcd-account-manager-priv.h index 80a1e0f..e89b1d3 100644 --- a/src/mcd-account-manager-priv.h +++ b/src/mcd-account-manager-priv.h @@ -28,9 +28,6 @@ #include "mcd-dbusprop.h" -/* auto-generated stubs */ -#include "_gen/svc-Account_Manager_Interface_Hidden.h" - G_BEGIN_DECLS G_GNUC_INTERNAL void _mcd_account_manager_setup diff --git a/src/mcd-account-manager.c b/src/mcd-account-manager.c index dc9ff20..55da9cb 100644 --- a/src/mcd-account-manager.c +++ b/src/mcd-account-manager.c @@ -59,24 +59,17 @@ static void account_manager_iface_init (TpSvcAccountManagerClass *iface, gpointer iface_data); -static void account_manager_hidden_iface_init ( - McSvcAccountManagerInterfaceHiddenClass *iface, - gpointer iface_data); static void properties_iface_init (TpSvcDBusPropertiesClass *iface, gpointer iface_data); static void _mcd_account_manager_constructed (GObject *obj); static const McdDBusProp account_manager_properties[]; -static const McdDBusProp account_manager_hidden_properties[]; static const McdInterfaceData account_manager_interfaces[] = { MCD_IMPLEMENT_IFACE (tp_svc_account_manager_get_type, account_manager, TP_IFACE_ACCOUNT_MANAGER), - MCD_IMPLEMENT_IFACE (mc_svc_account_manager_interface_hidden_get_type, - account_manager_hidden, - MC_IFACE_ACCOUNT_MANAGER_INTERFACE_HIDDEN), { G_TYPE_INVALID, } }; @@ -558,17 +551,9 @@ on_account_validity_changed (McdAccount *account, gboolean valid, object_path = mcd_account_get_object_path (account); - if (_mcd_account_is_hidden (account)) - { - mc_svc_account_manager_interface_hidden_emit_hidden_account_validity_changed ( - account_manager, object_path, valid); - } - else - { - tp_svc_account_manager_emit_account_validity_changed (account_manager, - object_path, - valid); - } + tp_svc_account_manager_emit_account_validity_changed (account_manager, + object_path, + valid); } static void @@ -580,16 +565,8 @@ on_account_removed (McdAccount *account, McdAccountManager *account_manager) object_path = mcd_account_get_object_path (account); - if (_mcd_account_is_hidden (account)) - { - mc_svc_account_manager_interface_hidden_emit_hidden_account_removed ( - account_manager, object_path); - } - else - { - tp_svc_account_manager_emit_account_removed (account_manager, - object_path); - } + tp_svc_account_manager_emit_account_removed (account_manager, + object_path); name = mcd_account_get_unique_name (account); g_hash_table_remove (priv->accounts, name); @@ -929,15 +906,7 @@ account_manager_iface_init (TpSvcAccountManagerClass *iface, } static void -account_manager_hidden_iface_init ( - McSvcAccountManagerInterfaceHiddenClass *iface, - gpointer iface_data) -{ -} - -static void -accounts_to_gvalue (GHashTable *accounts, gboolean valid, gboolean hidden, - GValue *value) +accounts_to_gvalue (GHashTable *accounts, gboolean valid, GValue *value) { static GType ao_type = G_TYPE_INVALID; GPtrArray *account_array; @@ -955,8 +924,7 @@ accounts_to_gvalue (GHashTable *accounts, gboolean valid, gboolean hidden, while (g_hash_table_iter_next (&iter, &k, (gpointer)&account)) { - if (mcd_account_is_valid (account) == valid && - _mcd_account_is_hidden (account) == hidden) + if (mcd_account_is_valid (account) == valid) { g_ptr_array_add (account_array, g_strdup (mcd_account_get_object_path (account))); @@ -975,7 +943,7 @@ get_valid_accounts (TpSvcDBusProperties *self, const gchar *name, McdAccountManagerPrivate *priv = account_manager->priv; DEBUG ("called"); - accounts_to_gvalue (priv->accounts, TRUE, FALSE, value); + accounts_to_gvalue (priv->accounts, TRUE, value); } static void @@ -986,7 +954,7 @@ get_invalid_accounts (TpSvcDBusProperties *self, const gchar *name, McdAccountManagerPrivate *priv = account_manager->priv; DEBUG ("called"); - accounts_to_gvalue (priv->accounts, FALSE, FALSE, value); + accounts_to_gvalue (priv->accounts, FALSE, value); } static void @@ -1005,7 +973,6 @@ get_supported_account_properties (TpSvcDBusProperties *svc, TP_PROP_ACCOUNT_SERVICE, TP_IFACE_ACCOUNT_INTERFACE_AVATAR ".Avatar", TP_PROP_ACCOUNT_INTERFACE_STORAGE_STORAGE_PROVIDER, - MC_IFACE_ACCOUNT_INTERFACE_HIDDEN ".Hidden", NULL }; @@ -1022,32 +989,6 @@ static const McdDBusProp account_manager_properties[] = { }; static void -get_valid_hidden_accounts (TpSvcDBusProperties *self, const gchar *name, - GValue *value) -{ - McdAccountManager *account_manager = MCD_ACCOUNT_MANAGER (self); - McdAccountManagerPrivate *priv = account_manager->priv; - - accounts_to_gvalue (priv->accounts, TRUE, TRUE, value); -} - -static void -get_invalid_hidden_accounts (TpSvcDBusProperties *self, const gchar *name, - GValue *value) -{ - McdAccountManager *account_manager = MCD_ACCOUNT_MANAGER (self); - McdAccountManagerPrivate *priv = account_manager->priv; - - accounts_to_gvalue (priv->accounts, FALSE, TRUE, value); -} - -static const McdDBusProp account_manager_hidden_properties[] = { - { "ValidHiddenAccounts", NULL, get_valid_hidden_accounts }, - { "InvalidHiddenAccounts", NULL, get_invalid_hidden_accounts }, - { 0 }, -}; - -static void properties_iface_init (TpSvcDBusPropertiesClass *iface, gpointer iface_data) { #define IMPLEMENT(x) tp_svc_dbus_properties_implement_##x (\ diff --git a/src/mcd-account-priv.h b/src/mcd-account-priv.h index f2f386e..649efa6 100644 --- a/src/mcd-account-priv.h +++ b/src/mcd-account-priv.h @@ -37,7 +37,6 @@ /* auto-generated stubs */ #include "_gen/svc-Account_Interface_External_Password_Storage.h" -#include "_gen/svc-Account_Interface_Hidden.h" #include "_gen/cli-Connection_Manager_Interface_Account_Storage.h" @@ -166,8 +165,6 @@ G_GNUC_INTERNAL gboolean _mcd_account_set_enabled (McdAccount *account, G_GNUC_INTERNAL gboolean _mcd_account_presence_type_is_settable ( TpConnectionPresenceType type); -gboolean _mcd_account_is_hidden (McdAccount *account); - G_GNUC_INTERNAL gboolean _mcd_account_needs_dispatch (McdAccount *account); G_GNUC_INTERNAL void _mcd_account_reconnect (McdAccount *self, diff --git a/src/mcd-account.c b/src/mcd-account.c index 1eac421..98300b8 100644 --- a/src/mcd-account.c +++ b/src/mcd-account.c @@ -62,9 +62,6 @@ static void account_avatar_iface_init (TpSvcAccountInterfaceAvatarClass *iface, static void account_storage_iface_init ( TpSvcAccountInterfaceStorageClass *iface, gpointer iface_data); -static void account_hidden_iface_init ( - McSvcAccountInterfaceHiddenClass *iface, - gpointer iface_data); static void account_external_password_storage_iface_init ( McSvcAccountInterfaceExternalPasswordStorageClass *iface, gpointer iface_data); @@ -72,7 +69,6 @@ static void account_external_password_storage_iface_init ( static const McdDBusProp account_properties[]; static const McdDBusProp account_avatar_properties[]; static const McdDBusProp account_storage_properties[]; -static const McdDBusProp account_hidden_properties[]; static const McdDBusProp account_external_password_storage_properties[]; static const McdInterfaceData account_interfaces[] = { @@ -86,9 +82,6 @@ static const McdInterfaceData account_interfaces[] = { MCD_IMPLEMENT_IFACE (tp_svc_account_interface_addressing_get_type, account_addressing, TP_IFACE_ACCOUNT_INTERFACE_ADDRESSING), - MCD_IMPLEMENT_IFACE (mc_svc_account_interface_hidden_get_type, - account_hidden, - MC_IFACE_ACCOUNT_INTERFACE_HIDDEN), MCD_IMPLEMENT_OPTIONAL_IFACE ( mc_svc_account_interface_external_password_storage_get_type, account_external_password_storage, @@ -171,7 +164,6 @@ struct _McdAccountPrivate gboolean waiting_for_initial_avatar; gboolean waiting_for_connectivity; - gboolean hidden; /* In addition to affecting dispatching, this flag also makes this * account bypass connectivity checks. */ gboolean always_dispatch; @@ -192,7 +184,6 @@ enum PROP_STORAGE, PROP_NAME, PROP_ALWAYS_ON, - PROP_HIDDEN, }; enum @@ -2215,66 +2206,6 @@ account_storage_iface_init (TpSvcAccountInterfaceStorageClass *iface, } static void -get_hidden (TpSvcDBusProperties *self, - const gchar *name, GValue *value) -{ - g_value_init (value, G_TYPE_BOOLEAN); - g_object_get_property (G_OBJECT (self), "hidden", value); -} - -static gboolean -set_hidden (TpSvcDBusProperties *self, - const gchar *name, - const GValue *value, - McdDBusPropSetFlags flags, - GError **error) -{ - McdAccount *account = MCD_ACCOUNT (self); - McdAccountPrivate *priv = account->priv; - const gchar *account_name = mcd_account_get_unique_name (account); - - if (!G_VALUE_HOLDS_BOOLEAN (value)) - { - g_set_error (error, TP_ERROR, TP_ERROR_INVALID_ARGUMENT, - "Hidden must be set to a boolean, not a %s", - G_VALUE_TYPE_NAME (value)); - return FALSE; - } - - /* Technically this property is immutable after the account's been created, - * but currently it's not easy for this code to tell whether or not this is - * a create-time property. It would probably be better if the create-time - * properties were passed into us as a construct-time GObject property. But - * that's a job for another month. - * - * So for now we check whether the value has changed, and violate the spec - * by making this property mutable (at least with the keyfile backend). - */ - if (mcd_storage_set_attribute (priv->storage, account_name, - MC_ACCOUNTS_KEY_HIDDEN, value)) - { - mcd_storage_commit (priv->storage, account_name); - mcd_account_changed_property (account, MC_ACCOUNTS_KEY_HIDDEN, value); - g_object_set_property (G_OBJECT (self), "hidden", value); - } - - return TRUE; -} - -static const McdDBusProp account_hidden_properties[] = { - { "Hidden", set_hidden, get_hidden }, - { 0 }, -}; - -static void -account_hidden_iface_init ( - McSvcAccountInterfaceHiddenClass *iface, - gpointer iface_data) -{ - /* wow, it's pretty crap that I need this. */ -} - -static void get_password_saved (TpSvcDBusProperties *self, const gchar *name, GValue *value) @@ -3316,8 +3247,6 @@ mcd_account_setup (McdAccount *account) priv->has_been_online = mcd_storage_get_boolean (storage, name, MC_ACCOUNTS_KEY_HAS_BEEN_ONLINE); - priv->hidden = - mcd_storage_get_boolean (storage, name, MC_ACCOUNTS_KEY_HIDDEN); /* special case flag (for ring accounts, so far) */ priv->always_dispatch = @@ -3477,9 +3406,6 @@ set_property (GObject *obj, guint prop_id, } break; - case PROP_HIDDEN: - priv->hidden = g_value_get_boolean (val); - break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (obj, prop_id, pspec); break; @@ -3505,9 +3431,6 @@ get_property (GObject *obj, guint prop_id, case PROP_NAME: g_value_set_string (val, priv->unique_name); break; - case PROP_HIDDEN: - g_value_set_boolean (val, priv->hidden); - break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (obj, prop_id, pspec); break; @@ -3741,11 +3664,6 @@ mcd_account_class_init (McdAccountClass * klass) G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY | G_PARAM_STATIC_STRINGS)); - g_object_class_install_property - (object_class, PROP_HIDDEN, - g_param_spec_boolean ("hidden", "Hidden?", "Is this account hidden?", - FALSE, - G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); /* Signals */ _mcd_account_signals[VALIDITY_CHANGED] = g_signal_new ("validity-changed", @@ -3870,14 +3788,6 @@ mcd_account_is_enabled (McdAccount *account) return priv->enabled; } -gboolean -_mcd_account_is_hidden (McdAccount *account) -{ - g_return_val_if_fail (MCD_IS_ACCOUNT (account), FALSE); - - return account->priv->hidden; -} - const gchar * mcd_account_get_unique_name (McdAccount *account) { diff --git a/src/mcd-storage-ag-hidden.c b/src/mcd-storage-ag-hidden.c deleted file mode 100644 index ee857a7..0000000 --- a/src/mcd-storage-ag-hidden.c +++ /dev/null @@ -1,99 +0,0 @@ -/* - * storage-ag-hidden.c - account backend for "magic" hidden accounts using - * accounts-glib - * Copyright ©2011 Collabora Ltd. - * Copyright ©2011 Nokia Corporation - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - */ - -#include "config.h" - -#include "mcd-storage-ag-hidden.h" - -#include - -#include "mcd-debug.h" -/* FIXME: if we weren't in-tree, we wouldn't be able to include this header and - * we'd have to re-hardcode magic strings like "Hidden". - */ -#include "mcd-account-config.h" - -static void account_storage_iface_init ( - McpAccountStorageIface *iface, - gpointer unused G_GNUC_UNUSED); - -G_DEFINE_TYPE_WITH_CODE (McdStorageAgHidden, mcd_storage_ag_hidden, - MCD_TYPE_ACCOUNT_MANAGER_SSO, - G_IMPLEMENT_INTERFACE (MCP_TYPE_ACCOUNT_STORAGE, - account_storage_iface_init); - ); - -static void -mcd_storage_ag_hidden_init (McdStorageAgHidden *self) -{ -} - -static void -mcd_storage_ag_hidden_class_init (McdStorageAgHiddenClass *klass) -{ - McdAccountManagerSsoClass *super = MCD_ACCOUNT_MANAGER_SSO_CLASS (klass); - - super->service_type = ACCOUNTS_GLIB_HIDDEN_SERVICE_TYPE; -} - -static gboolean -_mcd_storage_ag_hidden_get ( - const McpAccountStorage *self, - const McpAccountManager *am, - const gchar *account_suffix, - const gchar *key) -{ - /* Chain up to the real implementation, checking whether this is an account - * we care about in the process. - */ - if (!_mcd_account_manager_sso_get (self, am, account_suffix, key)) - return FALSE; - - /* If the caller is looking for the "Hidden" key (or NULL, which means - * everything), let's fill it in. (Every account this plugin cares about - * should be hidden.) - */ - if (key == NULL || !tp_strdiff (key, MC_ACCOUNTS_KEY_HIDDEN)) - mcp_account_manager_set_value (am, account_suffix, MC_ACCOUNTS_KEY_HIDDEN, - "true"); - - return TRUE; -} - -static void -account_storage_iface_init ( - McpAccountStorageIface *iface, - gpointer unused G_GNUC_UNUSED) -{ - mcp_account_storage_iface_set_name (iface, - "maemo-libaccounts-hidden"); - mcp_account_storage_iface_set_desc (iface, - "Loads accounts with service type '" ACCOUNTS_GLIB_HIDDEN_SERVICE_TYPE - "' from accounts-glib, and marks them as Hidden"); - mcp_account_storage_iface_implement_get (iface, - _mcd_storage_ag_hidden_get); -} - -McdStorageAgHidden * -mcd_storage_ag_hidden_new () -{ - return g_object_new (MCD_TYPE_STORAGE_AG_HIDDEN, NULL); -} diff --git a/src/mcd-storage-ag-hidden.h b/src/mcd-storage-ag-hidden.h deleted file mode 100644 index 2d9311f..0000000 --- a/src/mcd-storage-ag-hidden.h +++ /dev/null @@ -1,59 +0,0 @@ -/* - * storage-ag-hidden.h - account backend for "magic" hidden accounts using - * accounts-glib - * Copyright ©2011 Collabora Ltd. - * Copyright ©2011 Nokia Corporation - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - */ - -#ifndef MCD_STORAGE_AG_HIDDEN_H -#define MCD_STORAGE_AG_HIDDEN_H - -#include -#include "mcd-account-manager-sso.h" - -typedef struct _McdStorageAgHidden McdStorageAgHidden; -typedef struct _McdStorageAgHiddenClass McdStorageAgHiddenClass; - -struct _McdStorageAgHiddenClass { - McdAccountManagerSsoClass parent_class; -}; - -struct _McdStorageAgHidden { - McdAccountManagerSso parent; -}; - -GType mcd_storage_ag_hidden_get_type (void); - -McdStorageAgHidden *mcd_storage_ag_hidden_new (void); - -/* TYPE MACROS */ -#define MCD_TYPE_STORAGE_AG_HIDDEN \ - (mcd_storage_ag_hidden_get_type ()) -#define MCD_STORAGE_AG_HIDDEN(obj) \ - (G_TYPE_CHECK_INSTANCE_CAST((obj), MCD_TYPE_STORAGE_AG_HIDDEN, McdStorageAgHidden)) -#define MCD_STORAGE_AG_HIDDEN_CLASS(klass) \ - (G_TYPE_CHECK_CLASS_CAST((klass), MCD_TYPE_STORAGE_AG_HIDDEN,\ - McdStorageAgHiddenClass)) -#define MCD_IS_STORAGE_AG_HIDDEN(obj) \ - (G_TYPE_CHECK_INSTANCE_TYPE((obj), MCD_TYPE_STORAGE_AG_HIDDEN)) -#define MCD_IS_STORAGE_AG_HIDDEN_CLASS(klass) \ - (G_TYPE_CHECK_CLASS_TYPE((klass), MCD_TYPE_STORAGE_AG_HIDDEN)) -#define MCD_STORAGE_AG_HIDDEN_GET_CLASS(obj) \ - (G_TYPE_INSTANCE_GET_CLASS ((obj), MCD_TYPE_STORAGE_AG_HIDDEN, \ - McdStorageAgHiddenClass)) - -#endif /* MCD_STORAGE_AG_HIDDEN_H */ diff --git a/src/mcd-storage.c b/src/mcd-storage.c index 4fab25d..fec00a1 100644 --- a/src/mcd-storage.c +++ b/src/mcd-storage.c @@ -43,9 +43,6 @@ #if ENABLE_LIBACCOUNTS_SSO #include "mcd-account-manager-sso.h" -# ifdef ACCOUNTS_GLIB_HIDDEN_SERVICE_TYPE -# include "mcd-storage-ag-hidden.h" -# endif #endif #define MAX_KEY_LENGTH (DBUS_MAXIMUM_NAME_LENGTH + 6) @@ -315,7 +312,6 @@ static struct { { "b", MC_ACCOUNTS_KEY_CONNECT_AUTOMATICALLY }, { "b", MC_ACCOUNTS_KEY_ENABLED }, { "b", MC_ACCOUNTS_KEY_HAS_BEEN_ONLINE }, - { "b", MC_ACCOUNTS_KEY_HIDDEN }, /* Strings */ { "s", MC_ACCOUNTS_KEY_AUTO_PRESENCE_MESSAGE }, @@ -645,9 +641,6 @@ add_libaccounts_plugins_if_enabled (void) { #if ENABLE_LIBACCOUNTS_SSO add_storage_plugin (MCP_ACCOUNT_STORAGE (mcd_account_manager_sso_new ())); -# ifdef ACCOUNTS_GLIB_HIDDEN_SERVICE_TYPE - add_storage_plugin (MCP_ACCOUNT_STORAGE (mcd_storage_ag_hidden_new ())); -# endif #endif } diff --git a/src/mcd.xml b/src/mcd.xml index 838ea7d..ba0f8d5 100644 --- a/src/mcd.xml +++ b/src/mcd.xml @@ -7,9 +7,6 @@ - - - diff --git a/tests/twisted/Makefile.am b/tests/twisted/Makefile.am index 00e6729..67f7721 100644 --- a/tests/twisted/Makefile.am +++ b/tests/twisted/Makefile.am @@ -74,7 +74,6 @@ TWISTED_BASIC_TESTS = \ # account-storage/*.py need their own instances. TWISTED_SPECIAL_BUILD_TESTS = \ account-manager/connectivity.py \ - account-manager/hidden.py \ account-storage/default-keyring-storage.py \ account-storage/diverted-storage.py diff --git a/tests/twisted/account-manager/hidden.py b/tests/twisted/account-manager/hidden.py deleted file mode 100644 index 9e9351b..0000000 --- a/tests/twisted/account-manager/hidden.py +++ /dev/null @@ -1,110 +0,0 @@ -# vim: set fileencoding=utf-8 : thanks python! you've been great -# Copyright © 2010 Nokia Corporation -# Copyright © 2010 Collabora Ltd. -# -# This library is free software; you can redistribute it and/or -# modify it under the terms of the GNU Lesser General Public -# License as published by the Free Software Foundation; either -# version 2.1 of the License, or (at your option) any later version. -# -# This library is distributed in the hope that it will be useful, but -# WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# Lesser General Public License for more details. -# -# You should have received a copy of the GNU Lesser General Public -# License along with this library; if not, write to the Free Software -# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA -# 02110-1301 USA - -from mctest import ( - exec_test, create_fakecm_account, Account, AccountManager, - tell_mc_to_die, resuscitate_mc, - ) -from servicetest import ( - EventPattern, assertEquals, assertContains, assertDoesNotContain, - call_async, - ) -import constants as cs - -def test_unhidden_account(q, bus, mc): - """ - Check that accounts don't default to being hidden, and don't show up in the - lists of hidden accounts. - """ - am = AccountManager(bus) - - params = { "account": "oh", "password": "hai" } - (cm_name_ref, account) = create_fakecm_account(q, bus, mc, params) - - assert not account.Properties.Get(cs.ACCOUNT_IFACE_HIDDEN, 'Hidden') - - am_hidden_props = am.Properties.GetAll(cs.AM_IFACE_HIDDEN) - assertEquals([], am_hidden_props['ValidHiddenAccounts']) - assertEquals([], am_hidden_props['InvalidHiddenAccounts']) - -def test_create_hidden_account(q, bus, mc): - """ - Check that a newly-created hidden account does not show up on the main - AccountManager interface, but does show up on AM.I.Hidden, has its - Hidden property set to True, and can be removed. - """ - am = AccountManager(bus) - - call_async(q, am.Properties, 'Get', cs.AM, - 'SupportedAccountProperties') - supported = q.expect('dbus-return', method='Get').value[0] - assertContains(cs.ACCOUNT_IFACE_HIDDEN + '.Hidden', supported) - - # Make a new hidden account, and check that it really is hidden. - params = { "account": "aperture@porti.co", "password": "tollgate" } - properties = { cs.ACCOUNT_IFACE_HIDDEN + '.Hidden': True } - - q.forbid_events([ - EventPattern('dbus-signal', path=cs.AM_PATH, - signal='AccountValidityChanged', interface=cs.AM), - ]) - cm_name_ref, account = create_fakecm_account(q, bus, mc, params, properties) - - valid_accounts = am.Properties.Get(cs.AM, 'ValidAccounts') - assertDoesNotContain(account.object_path, valid_accounts) - - valid_hidden_accounts = am.Properties.Get(cs.AM_IFACE_HIDDEN, - 'ValidHiddenAccounts') - assertContains(account.object_path, valid_hidden_accounts) - - # Blow MC away, revive it, and check that the account is still hidden. - tell_mc_to_die(q, bus) - am, properties, interfaces = resuscitate_mc(q, bus, mc) - account = Account(bus, account.object_path) - - assert account.Properties.Get(cs.ACCOUNT_IFACE_HIDDEN, 'Hidden') - - assertDoesNotContain(account.object_path, properties['ValidAccounts']) - - valid_hidden_accounts = am.Properties.Get(cs.AM_IFACE_HIDDEN, - 'ValidHiddenAccounts') - assertContains(account.object_path, valid_hidden_accounts) - - # Delete the account, and check that its removal is signalled only on - # AM.I.Hidden, not on the main AM interface. - q.forbid_events([ - EventPattern('dbus-signal', path=cs.AM_PATH, - signal='AccountRemoved', interface=cs.AM, - args=[account.object_path]), - ]) - - account.Remove() - q.expect_many( - EventPattern('dbus-signal', path=cs.AM_PATH, - signal='HiddenAccountRemoved', interface=cs.AM_IFACE_HIDDEN), - EventPattern('dbus-signal', path=account.object_path, - signal='Removed', interface=cs.ACCOUNT), - ) - -def test(q, bus, mc): - test_unhidden_account(q, bus, mc) - test_create_hidden_account(q, bus, mc) - -if __name__ == '__main__': - exec_test(test, {}, timeout=10) diff --git a/tests/twisted/constants.py b/tests/twisted/constants.py index 0c7bc57..f06b496 100644 --- a/tests/twisted/constants.py +++ b/tests/twisted/constants.py @@ -591,11 +591,9 @@ CLIENT_IFACE_REQUESTS = CLIENT + '.Interface.Requests' ACCOUNT = PREFIX + '.Account' ACCOUNT_IFACE_AVATAR = ACCOUNT + '.Interface.Avatar' ACCOUNT_IFACE_ADDRESSING = ACCOUNT + '.Interface.Addressing' -ACCOUNT_IFACE_HIDDEN = ACCOUNT + '.Interface.Hidden.DRAFT1' ACCOUNT_PATH_PREFIX = PATH_PREFIX + '/Account/' AM = PREFIX + '.AccountManager' -AM_IFACE_HIDDEN = AM + '.Interface.Hidden.DRAFT1' AM_PATH = PATH_PREFIX + '/AccountManager' CR = PREFIX + '.ChannelRequest' diff --git a/tests/twisted/mctest.py b/tests/twisted/mctest.py index 9bcd287..653cba1 100644 --- a/tests/twisted/mctest.py +++ b/tests/twisted/mctest.py @@ -1031,16 +1031,8 @@ def create_fakecm_account(q, bus, mc, params, properties={}, servicetest.call_async(q, account_manager, 'CreateAccount', 'fakecm', 'fakeprotocol', 'fakeaccount', params, properties) - # Check whether the account being created is to be hidden; if so, then - # expect a different signal. It annoys me that this has to be in here, but, - # eh. - if properties.get(cs.ACCOUNT_IFACE_HIDDEN + '.Hidden', False): - validity_changed_pattern = servicetest.EventPattern('dbus-signal', - path=cs.AM_PATH, signal='HiddenAccountValidityChanged', - interface=cs.AM_IFACE_HIDDEN) - else: - validity_changed_pattern = servicetest.EventPattern('dbus-signal', - path=cs.AM_PATH, signal='AccountValidityChanged', interface=cs.AM) + validity_changed_pattern = servicetest.EventPattern('dbus-signal', + path=cs.AM_PATH, signal='AccountValidityChanged', interface=cs.AM) # The spec has no order guarantee here. # FIXME: MC ought to also introspect the CM and find out that the params diff --git a/xml/Account_Interface_Hidden.xml b/xml/Account_Interface_Hidden.xml deleted file mode 100644 index cb00191..0000000 --- a/xml/Account_Interface_Hidden.xml +++ /dev/null @@ -1,65 +0,0 @@ - - - - Copyright © 2010 Collabora Ltd. - -

This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version.

- -

This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details.

- -

You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA - 02110-1301, USA.

-
- - - (draft 1) - - -

An interface for flagging certain accounts as hidden, so that they do - not appear in the account manager's standard lists of accounts. - Accounts whose Hidden property is - True are intended for non-interactive use (by - non-user-visible services), and appear on the AccountManager.Interface.Hidden.DRAFT1 - interface; in all other respects, they behave like any other - account.

- - -

XMPP, in particular, is increasingly used for purposes other than - instant messaging and VoIP. For instance, extensions exist for - inter-device bookmark synchronization.

- -

While obviously these services could re-use connections intended for - instant messaging, in some cases you might want to use a different - account. (Perhaps your bookmark sync provider is not your IM - provider.) This API allows such auxiliary accounts to exist in - Telepathy, while not being displayed in standard user interfaces for - IM, VoIP, and friends.

-
-
- - - -

If True, this account is intended for non-interactive - use, and thus should not be presented to the user. It will not appear - in properties and signals on the main AccountManager interface; instead, it - will show up on AccountManager.Interface.Hidden.DRAFT1.

-
-
- -
-
- diff --git a/xml/Account_Manager_Interface_Hidden.xml b/xml/Account_Manager_Interface_Hidden.xml deleted file mode 100644 index 284eb64..0000000 --- a/xml/Account_Manager_Interface_Hidden.xml +++ /dev/null @@ -1,100 +0,0 @@ - - - Copyright © 2010 Collabora Ltd. - Copyright © 2010 Nokia Corporation - -

This library is free software; you can redistribute it and/or -modify it under the terms of the GNU Lesser General Public -License as published by the Free Software Foundation; either -version 2.1 of the License, or (at your option) any later version.

- -

This library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Lesser General Public License for more details.

- -

You should have received a copy of the GNU Lesser General Public -License along with this library; if not, write to the Free Software -Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -

-
- - - -

This interface lists accounts whose Hidden - property is True.

-
- first draft - - - - A list of valid (complete, usable) Accounts intended - exclusively for noninteractive applications. These accounts are not - included in AccountManager.ValidAccounts. Change - notification is via - HiddenAccountValidityChanged. - - - - - - A list of incomplete or otherwise unusable Accounts intended - exclusively for noninteractive applications. Change notification is via - HiddenAccountValidityChanged. - - - - - - The given account has been removed from - ValidHiddenAccounts or - InvalidHiddenAccounts. - - - - - An Account, which must not be used any more. - - - - - - - The validity of the given account has changed. New magic - accounts are also indicated by this signal, as an account validity - change (usually to True) on an account that did not previously exist. - - - This is effectively change notification for the valid and invalid - accounts lists. - - - - - - An Account. - - - - - - True if the account is now valid. - - - - -
-
- diff --git a/xml/Makefile.am b/xml/Makefile.am index 8d4c535..f1320fb 100644 --- a/xml/Makefile.am +++ b/xml/Makefile.am @@ -5,9 +5,7 @@ DROP_NAMESPACE = sed -e 's@xmlns:tp="http://telepathy\.freedesktop\.org/wiki/Dbu DROP_TPTYPE = sed -e 's@tp:type="[^"]*"@@g' SPECS = \ - Account_Manager_Interface_Hidden.xml \ Account_Interface_External_Password_Storage.xml \ - Account_Interface_Hidden.xml \ Connection_Manager_Interface_Account_Storage.xml \ Channel_Dispatcher_Interface_Messages_DRAFT.xml diff --git a/xml/nmc5.xml b/xml/nmc5.xml index bb4a590..c966870 100644 --- a/xml/nmc5.xml +++ b/xml/nmc5.xml @@ -5,8 +5,6 @@ Copyright (C) 2008 Nokia Corporation - - -- 1.8.4.rc3