commit 03c33e03f63701e966309ad8e4dd20cb2dc4e038
parent 3926235d57ed602af4c82ab236b32c64bef62efb
Author: rhunk <101876869+rhunk@users.noreply.github.com>
Date:   Wed,  6 Sep 2023 23:07:49 +0200

fix(media_downloader): prevent story self auto download

Diffstat:
Mcore/src/main/kotlin/me/rhunk/snapenhance/features/impl/downloader/MediaDownloader.kt | 6++++--
1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/core/src/main/kotlin/me/rhunk/snapenhance/features/impl/downloader/MediaDownloader.kt b/core/src/main/kotlin/me/rhunk/snapenhance/features/impl/downloader/MediaDownloader.kt @@ -273,7 +273,6 @@ class MediaDownloader : MessagingRuleFeature("MediaDownloader", MessagingRuleTyp conversationParticipants.firstOrNull { it != conversationMessage.senderId } } - if (!forceDownload && context.config.downloader.preventSelfAutoDownload.get() && storyUserId == context.database.myUserId) return val author = context.database.getFriendInfo( if (storyUserId == null || storyUserId == "null") @@ -282,7 +281,10 @@ class MediaDownloader : MessagingRuleFeature("MediaDownloader", MessagingRuleTyp ) ?: throw Exception("Friend not found in database") val authorName = author.usernameForSorting!! - if (!forceDownload && !canUseRule(author.userId!!)) return + if (!forceDownload) { + if (context.config.downloader.preventSelfAutoDownload.get() && author.userId == context.database.myUserId) return + if (!canUseRule(author.userId!!)) return + } downloadOperaMedia(provideDownloadManagerClient( mediaIdentifier = paramMap["MEDIA_ID"].toString(),