diff --git a/matrix/services/sync/src/main/kotlin/app/dapk/st/matrix/sync/internal/sync/RoomEventCreator.kt b/matrix/services/sync/src/main/kotlin/app/dapk/st/matrix/sync/internal/sync/RoomEventCreator.kt
index 4d15423..09fd61e 100644
--- a/matrix/services/sync/src/main/kotlin/app/dapk/st/matrix/sync/internal/sync/RoomEventCreator.kt
+++ b/matrix/services/sync/src/main/kotlin/app/dapk/st/matrix/sync/internal/sync/RoomEventCreator.kt
@@ -162,11 +162,6 @@ internal class TimelineEventMapper(
}
-private fun String.stripTags() = this.substring(this.indexOf("") + "".length)
- .trim()
- .replace("", "")
- .replace("", "")
-
private fun ApiTimelineEvent.TimelineMessage.isEdit() = this.content.relation?.relationType == "m.replace" && this.content.relation?.eventId != null
private fun ApiTimelineEvent.TimelineMessage.isReply() = this.content.relation?.inReplyTo != null
private fun ApiTimelineEvent.TimelineMessage.asTextContent() = this.content as ApiTimelineEvent.TimelineMessage.Content.Text
diff --git a/matrix/services/sync/src/main/kotlin/app/dapk/st/matrix/sync/internal/sync/RoomEventFactory.kt b/matrix/services/sync/src/main/kotlin/app/dapk/st/matrix/sync/internal/sync/RoomEventFactory.kt
index a7d186d..f1e3ef3 100644
--- a/matrix/services/sync/src/main/kotlin/app/dapk/st/matrix/sync/internal/sync/RoomEventFactory.kt
+++ b/matrix/services/sync/src/main/kotlin/app/dapk/st/matrix/sync/internal/sync/RoomEventFactory.kt
@@ -53,9 +53,19 @@ internal class RoomEventFactory(
}
}
-private fun String.stripTags() = this.substring(this.indexOf("") + "".length)
+
+private fun String.indexOfOrNull(string: String) = this.indexOf(string).takeIf { it != -1 }
+
+fun String.stripTags() = this
+ .run {
+ this.indexOfOrNull("")?.let {
+ this.substring(it + "".length)
+ } ?: this
+ }
.trim()
.replace("", "")
.replace("", "")
+ .replace(""", "\"")
+ .replace("'", "'")
private fun ApiTimelineEvent.TimelineMessage.asTextContent() = this.content as ApiTimelineEvent.TimelineMessage.Content.Text