Allow user to load installed extensions regardless of content warning (#3952)
This commit is contained in:
@@ -223,7 +223,9 @@ internal object ExtensionLoader {
|
||||
*/
|
||||
private suspend fun loadExtension(context: Context, extensionInfo: ExtensionInfo): LoadResult {
|
||||
val trustExtension: TrustExtension = context.appGraph.trustExtension
|
||||
val enabledContentWarnings = context.appGraph.sourcePreferences.enabledContentWarnings.get()
|
||||
val sourcePreferences = context.appGraph.sourcePreferences
|
||||
val enabledContentWarnings = sourcePreferences.enabledContentWarnings.get()
|
||||
val applyContentWarningsToInstalled = sourcePreferences.applyContentWarningsToInstalled.get()
|
||||
|
||||
val pkgManager = context.packageManager
|
||||
val pkgInfo = extensionInfo.packageInfo
|
||||
@@ -281,7 +283,7 @@ internal object ExtensionLoader {
|
||||
appInfo.metaData.getInt(METADATA_NSFW) == 1 -> ContentWarning.NSFW
|
||||
else -> ContentWarning.SAFE
|
||||
}
|
||||
if (contentWarning !in enabledContentWarnings) {
|
||||
if (applyContentWarningsToInstalled && contentWarning !in enabledContentWarnings) {
|
||||
logcat(LogPriority.WARN) { "Extension $pkgName with $contentWarning not allowed" }
|
||||
return LoadResult.Error
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user