Merge pull request #5 from endlessm/T23999-oars-1.1

accounts-service: Add support for oars-1.1
This commit is contained in:
Will Thompson 2018-10-12 13:19:26 +01:00 committed by GitHub
commit 6637edaebd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 5 deletions

View File

@ -41,7 +41,7 @@
Its a two-tuple of the rating type, and a dictionary of rating sections
and values. The type gives the rating scheme in use — currently only
`oars-1.0` is supported.
`oars-1.0` and `oars-1.1` are supported.
Each dictionary entry is a mapping from an OARS section to the
most severe value for it which the user is allowed to see (inclusive). Any
@ -57,7 +57,7 @@
-->
<property name="oars-filter" type="(sa{ss})" access="readwrite">
<annotation name="org.freedesktop.Accounts.DefaultValue"
value="('oars-1.0', @a{ss} {})"/>
value="('oars-1.1', @a{ss} {})"/>
</property>
</interface>
</node>

View File

@ -403,13 +403,14 @@ get_app_filter_cb (GObject *obj,
&content_rating_kind, &oars_variant))
{
/* Default value. */
content_rating_kind = "oars-1.0";
content_rating_kind = "oars-1.1";
oars_variant = g_variant_new ("@a{ss} {}");
}
/* Check that the OARS filter is in a format we support. Currently, thats
* only oars-1.0. */
if (!g_str_equal (content_rating_kind, "oars-1.0"))
* only oars-1.0 and oars-1.1. */
if (!g_str_equal (content_rating_kind, "oars-1.0") &&
!g_str_equal (content_rating_kind, "oars-1.1"))
{
g_task_return_new_error (task, EPC_APP_FILTER_ERROR,
EPC_APP_FILTER_ERROR_INVALID_DATA,