ktlint format
This commit is contained in:
parent
bac6d271ca
commit
78dfac52a7
|
@ -92,7 +92,6 @@ interface TimelineService {
|
|||
*/
|
||||
fun mapEventsWithEdition(threads: List<TimelineEvent>): List<TimelineEvent>
|
||||
|
||||
|
||||
/**
|
||||
* Marks the current thread as read. This is a local implementation
|
||||
* @param rootThreadEventId the eventId of the current thread
|
||||
|
|
|
@ -45,7 +45,6 @@ internal fun Map<String, EventEntity>.updateThreadSummaryIfNeeded(
|
|||
realm: Realm, currentUserId: String,
|
||||
chunkEntity: ChunkEntity? = null,
|
||||
shouldUpdateNotifications: Boolean = true) {
|
||||
|
||||
for ((rootThreadEventId, eventEntity) in this) {
|
||||
eventEntity.threadSummaryInThread(eventEntity.realm, rootThreadEventId, chunkEntity)?.let { threadSummary ->
|
||||
|
||||
|
@ -59,7 +58,6 @@ internal fun Map<String, EventEntity>.updateThreadSummaryIfNeeded(
|
|||
threadsCounted = numberOfMessages,
|
||||
latestMessageTimelineEventEntity = latestEventInThread
|
||||
)
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -96,7 +94,6 @@ internal fun EventEntity.markEventAsRoot(
|
|||
* @return A ThreadSummary containing the counted threads and the latest event message
|
||||
*/
|
||||
internal fun EventEntity.threadSummaryInThread(realm: Realm, rootThreadEventId: String, chunkEntity: ChunkEntity?): ThreadSummary {
|
||||
|
||||
// Number of messages
|
||||
val messages = TimelineEventEntity
|
||||
.whereRoomId(realm, roomId = roomId)
|
||||
|
|
|
@ -334,7 +334,7 @@ internal class EventRelationsAggregationProcessor @Inject constructor(
|
|||
}
|
||||
}
|
||||
|
||||
if(!isLocalEcho) {
|
||||
if (!isLocalEcho) {
|
||||
val replaceEvent = TimelineEventEntity.where(realm, roomId, eventId).findFirst()
|
||||
handleThreadSummaryEdition(editedEvent, replaceEvent, existingSummary?.editions)
|
||||
}
|
||||
|
|
|
@ -21,7 +21,6 @@ import org.matrix.android.sdk.api.session.events.model.Event
|
|||
import org.matrix.android.sdk.api.session.events.model.EventType
|
||||
import org.matrix.android.sdk.api.session.events.model.LocalEcho
|
||||
import org.matrix.android.sdk.api.session.events.model.UnsignedData
|
||||
import org.matrix.android.sdk.api.session.room.model.relation.RelationContent
|
||||
import org.matrix.android.sdk.internal.database.mapper.ContentMapper
|
||||
import org.matrix.android.sdk.internal.database.mapper.EventMapper
|
||||
import org.matrix.android.sdk.internal.database.model.EventEntity
|
||||
|
|
|
@ -560,7 +560,7 @@ internal class LocalEchoEventFactory @Inject constructor(
|
|||
relatesTo = generateReplyRelationContent(
|
||||
eventId = eventId,
|
||||
rootThreadEventId = rootThreadEventId,
|
||||
showAsReply = showInThread ))
|
||||
showAsReply = showInThread))
|
||||
return createMessageEvent(roomId, content)
|
||||
}
|
||||
|
||||
|
|
|
@ -26,7 +26,6 @@ import im.vector.app.core.di.hiltMavericksViewModelFactory
|
|||
import im.vector.app.core.extensions.exhaustive
|
||||
import im.vector.app.core.platform.VectorViewModel
|
||||
import im.vector.app.core.resources.StringProvider
|
||||
import im.vector.app.core.resources.UserPreferencesProvider
|
||||
import im.vector.app.features.analytics.AnalyticsTracker
|
||||
import im.vector.app.features.analytics.extensions.toAnalyticsJoinedRoom
|
||||
import im.vector.app.features.attachments.toContentAttachmentData
|
||||
|
@ -503,7 +502,7 @@ class MessageComposerViewModel @AssistedInject constructor(
|
|||
is SendMode.Reply -> {
|
||||
val timelineEvent = state.sendMode.timelineEvent
|
||||
val showInThread = state.sendMode.timelineEvent.root.isThread() && state.rootThreadEventId == null
|
||||
val rootThreadEventId = if(showInThread) timelineEvent.root.getRootThreadEventId() else null
|
||||
val rootThreadEventId = if (showInThread) timelineEvent.root.getRootThreadEventId() else null
|
||||
state.rootThreadEventId?.let {
|
||||
room.replyInThread(
|
||||
rootThreadEventId = it,
|
||||
|
|
|
@ -30,8 +30,8 @@ import im.vector.app.core.epoxy.onClick
|
|||
import im.vector.app.core.extensions.setTextOrHide
|
||||
import im.vector.app.features.displayname.getBestName
|
||||
import im.vector.app.features.home.AvatarRenderer
|
||||
import org.matrix.android.sdk.api.session.threads.ThreadDetails
|
||||
import im.vector.lib.core.utils.epoxy.charsequence.EpoxyCharSequence
|
||||
import org.matrix.android.sdk.api.session.threads.ThreadDetails
|
||||
import org.matrix.android.sdk.api.util.MatrixItem
|
||||
|
||||
@EpoxyModelClass(layout = R.layout.item_search_result)
|
||||
|
|
|
@ -27,7 +27,6 @@ import org.matrix.android.sdk.api.session.events.model.toModel
|
|||
import org.matrix.android.sdk.api.session.room.model.Membership
|
||||
import org.matrix.android.sdk.api.session.room.model.RoomMemberContent
|
||||
import org.matrix.android.sdk.api.session.room.timeline.TimelineEvent
|
||||
import timber.log.Timber
|
||||
import javax.inject.Inject
|
||||
|
||||
class TimelineEventVisibilityHelper @Inject constructor(private val userPreferencesProvider: UserPreferencesProvider) {
|
||||
|
@ -138,8 +137,7 @@ class TimelineEventVisibilityHelper @Inject constructor(private val userPreferen
|
|||
}
|
||||
|
||||
private fun TimelineEvent.shouldBeHidden(rootThreadEventId: String?, isFromThreadTimeline: Boolean): Boolean {
|
||||
|
||||
if (root.isRedacted() && !userPreferencesProvider.shouldShowRedactedMessages() && root.threadDetails?.isRootThread == false ) {
|
||||
if (root.isRedacted() && !userPreferencesProvider.shouldShowRedactedMessages() && root.threadDetails?.isRootThread == false) {
|
||||
return true
|
||||
}
|
||||
|
||||
|
@ -147,14 +145,14 @@ class TimelineEventVisibilityHelper @Inject constructor(private val userPreferen
|
|||
if (root.isRedacted() &&
|
||||
userPreferencesProvider.areThreadMessagesEnabled() &&
|
||||
!isFromThreadTimeline &&
|
||||
(root.isThread() || root.threadDetails?.isThread == true)){
|
||||
(root.isThread() || root.threadDetails?.isThread == true)) {
|
||||
return true
|
||||
}
|
||||
if (root.isRedacted() &&
|
||||
!userPreferencesProvider.shouldShowRedactedMessages() &&
|
||||
userPreferencesProvider.areThreadMessagesEnabled() &&
|
||||
isFromThreadTimeline &&
|
||||
root.isThread()){
|
||||
root.isThread()) {
|
||||
return true
|
||||
}
|
||||
|
||||
|
|
|
@ -20,7 +20,6 @@ import android.content.Context
|
|||
import android.content.Intent
|
||||
import android.os.Bundle
|
||||
import androidx.fragment.app.FragmentTransaction
|
||||
import com.google.android.material.appbar.MaterialToolbar
|
||||
import dagger.hilt.android.AndroidEntryPoint
|
||||
import im.vector.app.R
|
||||
import im.vector.app.core.extensions.addFragmentToBackstack
|
||||
|
|
Loading…
Reference in New Issue