From ed1e0868d87c310cfec4fda155839f024ffaa39c Mon Sep 17 00:00:00 2001 From: Mathieu Parent Date: Sun, 22 Oct 2023 14:54:22 +0000 Subject: [PATCH] Only filter by MIME types on block mode Otherwise, allow list is not working --- libmalcontent/app-filter.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/libmalcontent/app-filter.c b/libmalcontent/app-filter.c index 914145f..ea774da 100644 --- a/libmalcontent/app-filter.c +++ b/libmalcontent/app-filter.c @@ -355,12 +355,14 @@ mct_app_filter_is_appinfo_allowed (MctAppFilter *filter, !mct_app_filter_is_path_allowed (filter, abs_path)) return FALSE; - types = g_app_info_get_supported_types (app_info); - for (gsize i = 0; types != NULL && types[i] != NULL; i++) - { - if (!mct_app_filter_is_content_type_allowed (filter, types[i])) - return FALSE; - } + if (filter->app_list_type == MCT_APP_FILTER_LIST_BLOCKLIST) { + types = g_app_info_get_supported_types (app_info); + for (gsize i = 0; types != NULL && types[i] != NULL; i++) + { + if (!mct_app_filter_is_content_type_allowed (filter, types[i])) + return FALSE; + } + } if (G_IS_DESKTOP_APP_INFO (app_info)) {