Merge pull request #260 from vector-im/feature/misc_quick_fixes

Feature/misc quick fixes
This commit is contained in:
Benoit Marty 2019-07-02 15:56:17 +02:00 committed by GitHub
commit fe81145680
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 1 deletions

View File

@ -49,6 +49,7 @@ internal fun RoomEntity.addStateEvents(stateEvents: List<Event>,
val eventEntity = event.toEntity(roomId).apply { val eventEntity = event.toEntity(roomId).apply {
this.stateIndex = stateIndex this.stateIndex = stateIndex
this.isUnlinked = isUnlinked this.isUnlinked = isUnlinked
this.sendState = SendState.SYNCED
} }
untimelinedStateEvents.add(0, eventEntity) untimelinedStateEvents.add(0, eventEntity)
} }

View File

@ -70,7 +70,7 @@ internal class LocalEchoEventFactory @Inject constructor(private val credentials
} }


private fun isFormattedTextPertinent(text: String, htmlText: String?) = private fun isFormattedTextPertinent(text: String, htmlText: String?) =
text != htmlText && htmlText != "<p>$text</p>\n" text != htmlText && htmlText != "<p>${text.trim()}</p>\n"


fun createFormattedTextEvent(roomId: String, text: String, formattedText: String): Event { fun createFormattedTextEvent(roomId: String, text: String, formattedText: String): Event {
val content = MessageTextContent( val content = MessageTextContent(