diff options
author | Richard Hughes <richard@hughsie.com> | 2015-11-26 09:32:31 +0000 |
---|---|---|
committer | Richard Hughes <richard@hughsie.com> | 2015-11-26 09:33:17 +0000 |
commit | 28c92dc20e8fbb7b1ae196a2af85a848e2b4372e (patch) | |
tree | be239f300f40da5522ef46e49cb5ba6ce3710991 | |
parent | f2300e8fda0733b973b3037cd7e46baafafa26a7 (diff) | |
download | appstream-glib-28c92dc20e8fbb7b1ae196a2af85a848e2b4372e.tar.gz |
Allow update_contact to be output in very limited conditions
-rw-r--r-- | libappstream-glib/as-app.c | 3 | ||||
-rw-r--r-- | libappstream-glib/as-node-private.h | 3 | ||||
-rw-r--r-- | libappstream-glib/as-node.c | 32 |
3 files changed, 37 insertions, 1 deletions
diff --git a/libappstream-glib/as-app.c b/libappstream-glib/as-app.c index a95c175..5de0bdd 100644 --- a/libappstream-glib/as-app.c +++ b/libappstream-glib/as-app.c @@ -3217,7 +3217,8 @@ as_app_node_insert (AsApp *app, GNode *parent, AsNodeContext *ctx) /* <update_contact> */ if (as_node_context_get_output (ctx) == AS_APP_SOURCE_KIND_APPDATA || - as_node_context_get_output (ctx) == AS_APP_SOURCE_KIND_METAINFO) { + as_node_context_get_output (ctx) == AS_APP_SOURCE_KIND_METAINFO || + as_node_context_get_output_trusted (ctx)) { if (priv->update_contact != NULL) { as_node_insert (node_app, "update_contact", priv->update_contact, 0, NULL); diff --git a/libappstream-glib/as-node-private.h b/libappstream-glib/as-node-private.h index 785afda..58cdb59 100644 --- a/libappstream-glib/as-node-private.h +++ b/libappstream-glib/as-node-private.h @@ -39,6 +39,9 @@ void as_node_context_set_version (AsNodeContext *ctx, AsAppSourceKind as_node_context_get_source_kind (AsNodeContext *ctx); void as_node_context_set_source_kind (AsNodeContext *ctx, AsAppSourceKind source_kind); +gboolean as_node_context_get_output_trusted (AsNodeContext *ctx); +void as_node_context_set_output_trusted (AsNodeContext *ctx, + gboolean output_trusted); AsAppSourceKind as_node_context_get_output (AsNodeContext *ctx); void as_node_context_set_output (AsNodeContext *ctx, AsAppSourceKind output); diff --git a/libappstream-glib/as-node.c b/libappstream-glib/as-node.c index db7f22d..32aadfb 100644 --- a/libappstream-glib/as-node.c +++ b/libappstream-glib/as-node.c @@ -1954,6 +1954,7 @@ struct _AsNodeContext { AsAppSourceKind source_kind; AsAppSourceKind output; gdouble version; + gboolean output_trusted; }; /** @@ -2039,6 +2040,37 @@ as_node_context_set_source_kind (AsNodeContext *ctx, AsAppSourceKind source_kind } /** + * as_node_context_get_output_trusted: (skip) + * @ctx: a #AsNodeContext. + * + * Gets if the AppStream output is trusted to handle private data. + * + * Returns: output_trusted number + * + * Since: 0.5.5 + **/ +gboolean +as_node_context_get_output_trusted (AsNodeContext *ctx) +{ + return ctx->output_trusted; +} + +/** + * as_node_context_set_output_trusted: (skip) + * @ctx: a #AsNodeContext. + * @output_trusted: boolean. + * + * Sets the AppStream output is trusted to handle private data. + * + * Since: 0.5.5 + **/ +void +as_node_context_set_output_trusted (AsNodeContext *ctx, gboolean output_trusted) +{ + ctx->output_trusted = output_trusted; +} + +/** * as_node_context_get_output: (skip) * @ctx: a #AsNodeContext. * |