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

Commit 728af516 authored by moezbhatti's avatar moezbhatti
Browse files

Fix indentation for constructor params

parent a1dfba2e
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -23,8 +23,8 @@ import javax.inject.Inject

class RecipientFilter @Inject constructor(
    private val contactFilter: ContactFilter,
        private val phoneNumberFilter: PhoneNumberFilter)
    : Filter<Recipient>() {
    private val phoneNumberFilter: PhoneNumberFilter
) : Filter<Recipient>() {

    override fun filter(item: Recipient, query: CharSequence) = when {
        item.contact?.let { contactFilter.filter(it, query) } == true -> true
+3 −1
Original line number Diff line number Diff line
@@ -49,7 +49,9 @@ class RemoteMessagingReceiver : BroadcastReceiver() {
        markRead.execute(listOf(threadId))

        val lastMessage = messageRepo.getMessages(threadId).lastOrNull()
        val subId = subscriptionManager.activeSubscriptionInfoList.firstOrNull { it.subscriptionId == lastMessage?.subId }?.subscriptionId ?: -1
        val subId = subscriptionManager.activeSubscriptionInfoList
                .firstOrNull { it.subscriptionId == lastMessage?.subId }
                ?.subscriptionId ?: -1
        val addresses = conversationRepo.getConversation(threadId)?.recipients?.map { it.address } ?: return

        val pendingRepository = goAsync()
+7 −6
Original line number Diff line number Diff line
@@ -63,7 +63,8 @@ class MessageRepositoryImpl @Inject constructor(
    private val messageIds: KeyManager,
    private val imageRepository: ImageRepository,
    private val prefs: Preferences,
        private val syncRepository: SyncRepository) : MessageRepository {
    private val syncRepository: SyncRepository
) : MessageRepository {

    override fun getMessages(threadId: Long, query: String): RealmResults<Message> {
        return Realm.getDefaultInstance()
+4 −3
Original line number Diff line number Diff line
@@ -34,7 +34,8 @@ import javax.inject.Singleton
class NightModeManager @Inject constructor(
    private val context: Context,
    private val prefs: Preferences,
        private val widgetManager: WidgetManager) {
    private val widgetManager: WidgetManager
) {

    fun updateCurrentTheme() {
        // If night mode is not on auto, then there's nothing to do here
+2 −4
Original line number Diff line number Diff line
@@ -26,13 +26,11 @@ data class Optional<out T>(val value: T?) {
    fun notNull() = value != null
}

fun <T, R> Flowable<T>.mapNotNull(mapper: (T) -> R?): Flowable<R>
        = map { input -> Optional(mapper(input)) }
fun <T, R> Flowable<T>.mapNotNull(mapper: (T) -> R?): Flowable<R> = map { input -> Optional(mapper(input)) }
        .filter { optional -> optional.notNull() }
        .map { optional -> optional.value }

fun <T, R> Observable<T>.mapNotNull(mapper: (T) -> R?): Observable<R>
        = map { input -> Optional(mapper(input)) }
fun <T, R> Observable<T>.mapNotNull(mapper: (T) -> R?): Observable<R> = map { input -> Optional(mapper(input)) }
        .filter { optional -> optional.notNull() }
        .map { optional -> optional.value }

Loading