Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 31e9d13e authored by narinder Rana's avatar narinder Rana
Browse files

build successful - fix build

parent b56310b5
Loading
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -26,7 +26,7 @@ import com.fsck.k9.mail.FolderType as RemoteFolderType
class FolderRepository(
    private val messageStoreManager: MessageStoreManager,
    private val accountManager: AccountManager,
    private val account: Account,
    //private val account: Account,
    private val ioDispatcher: CoroutineDispatcher = Dispatchers.IO
) {
    private val sortForDisplay =
+1 −1
Original line number Diff line number Diff line
@@ -24,7 +24,7 @@ import com.fsck.k9.mail.internet.AddressHeaderBuilder;
import com.fsck.k9.mail.internet.MimeMessage;
import com.fsck.k9.mail.message.MessageHeaderParser;
import com.fsck.k9.mailstore.LockableDatabase.DbCallback;
import com.fsck.k9.mailstore.LockableDatabase.WrappedException;
//import com.fsck.k9.mailstore.LockableDatabase.WrappedException;
import com.fsck.k9.message.extractors.PreviewResult.PreviewType;
import timber.log.Timber;

+14 −14
Original line number Diff line number Diff line
@@ -6,7 +6,7 @@ import android.content.Context
import androidx.core.app.NotificationCompat
import com.fsck.k9.Account
import com.fsck.k9.K9
import com.fsck.k9.K9.NotificationHideSubject
//import com.fsck.k9.K9.NotificationHideSubject
import com.fsck.k9.K9.NotificationQuickDelete
import com.fsck.k9.notification.NotificationGroupKeys.getGroupKey
import com.fsck.k9.notification.NotificationIds.getNewMailSummaryNotificationId
@@ -23,9 +23,9 @@ internal open class DeviceNotifications(
        val unreadMessageCount = notificationData.unreadMessageCount

        val builder = when {
            isPrivacyModeActive -> {
                createSimpleSummaryNotification(account, unreadMessageCount)
            }
//            isPrivacyModeActive -> {
//                createSimpleSummaryNotification(account, unreadMessageCount)
//            }
            notificationData.isSingleMessageNotification -> {
                val holder = notificationData.holderForLatestNotification
                createBigTextStyleSummaryNotification(account, holder)
@@ -62,14 +62,14 @@ internal open class DeviceNotifications(
        val newMailText = resourceProvider.newMailTitle()
        val unreadMessageCountText = resourceProvider.newMailUnreadMessageCount(unreadMessageCount, accountName)
        val notificationId = getNewMailSummaryNotificationId(account)
        val contentIntent = actionCreator.createViewFolderListPendingIntent(account, notificationId)
       // val contentIntent = actionCreator.createViewFolderListPendingIntent(account, notificationId)

        return createAndInitializeNotificationBuilder(account)
            .setNumber(unreadMessageCount)
            .setTicker(newMailText)
            .setContentTitle(unreadMessageCountText)
            .setContentText(newMailText)
            .setContentIntent(contentIntent)
            //.setContentIntent(contentIntent)
    }

    private fun createBigTextStyleSummaryNotification(
@@ -194,14 +194,14 @@ internal open class DeviceNotifications(
        builder.addAction(icon, title, replyToMessagePendingIntent)
    }

    private val isPrivacyModeActive: Boolean
        get() {
            val keyguardService = context.getSystemService(Context.KEYGUARD_SERVICE) as KeyguardManager
            val privacyModeAlwaysEnabled = K9.notificationHideSubject === NotificationHideSubject.ALWAYS
            val privacyModeEnabledWhenLocked = K9.notificationHideSubject === NotificationHideSubject.WHEN_LOCKED
            val screenLocked = keyguardService.inKeyguardRestrictedInputMode()
            return privacyModeAlwaysEnabled || privacyModeEnabledWhenLocked && screenLocked
        }
//    private val isPrivacyModeActive: Boolean
//        get() {
//            val keyguardService = context.getSystemService(Context.KEYGUARD_SERVICE) as KeyguardManager
//            val privacyModeAlwaysEnabled = K9.notificationHideSubject === NotificationHideSubject.ALWAYS
//            val privacyModeEnabledWhenLocked = K9.notificationHideSubject === NotificationHideSubject.WHEN_LOCKED
//            val screenLocked = keyguardService.inKeyguardRestrictedInputMode()
//            return privacyModeAlwaysEnabled || privacyModeEnabledWhenLocked && screenLocked
//        }

    protected open fun createInboxStyle(builder: NotificationCompat.Builder?): NotificationCompat.InboxStyle {
        return NotificationCompat.InboxStyle(builder)
+2 −0
Original line number Diff line number Diff line
@@ -14,6 +14,8 @@ interface NotificationActionCreator {
        notificationId: Int
    ): PendingIntent

    fun createViewFolderListPendingIntent(account: Account, notificationId: Int): PendingIntent

    fun createDismissAllMessagesPendingIntent(account: Account, notificationId: Int): PendingIntent

    fun createDismissMessagePendingIntent(
+9 −0
Original line number Diff line number Diff line
@@ -56,8 +56,17 @@ class NotificationActionService : Service() {
        }
    }

//    private fun deleteMessages(intent: Intent) {
//        Timber.i("NotificationActionService deleting messages")
//        messagingController.deleteMessages(messageReferences)
//    }

    private fun deleteMessages(intent: Intent) {
        Timber.i("NotificationActionService deleting messages")

        val messageReferenceStrings = intent.getStringArrayListExtra(EXTRA_MESSAGE_REFERENCES)
        val messageReferences = MessageReferenceHelper.toMessageReferenceList(messageReferenceStrings)

        messagingController.deleteMessages(messageReferences)
    }

Loading