-
Notifications
You must be signed in to change notification settings - Fork 790
Don't mark room as unread due to reactions #5846
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: develop
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Don't mark room as unread due to reactions |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,7 +17,6 @@ | |
package im.vector.app.features.home.room.detail.timeline.format | ||
|
||
import dagger.Lazy | ||
import im.vector.app.EmojiSpanify | ||
import im.vector.app.R | ||
import im.vector.app.core.resources.ColorProvider | ||
import im.vector.app.core.resources.StringProvider | ||
|
@@ -32,7 +31,6 @@ import org.matrix.android.sdk.api.session.room.model.message.MessageContent | |
import org.matrix.android.sdk.api.session.room.model.message.MessagePollContent | ||
import org.matrix.android.sdk.api.session.room.model.message.MessageTextContent | ||
import org.matrix.android.sdk.api.session.room.model.message.MessageType | ||
import org.matrix.android.sdk.api.session.room.model.relation.ReactionContent | ||
import org.matrix.android.sdk.api.session.room.timeline.TimelineEvent | ||
import org.matrix.android.sdk.api.session.room.timeline.getLastMessageContent | ||
import org.matrix.android.sdk.api.session.room.timeline.getTextDisplayableContent | ||
|
@@ -41,7 +39,6 @@ import javax.inject.Inject | |
class DisplayableEventFormatter @Inject constructor( | ||
private val stringProvider: StringProvider, | ||
private val colorProvider: ColorProvider, | ||
private val emojiSpanify: EmojiSpanify, | ||
private val noticeEventFormatter: NoticeEventFormatter, | ||
private val htmlRenderer: Lazy<EventHtmlRenderer> | ||
) { | ||
|
@@ -103,12 +100,6 @@ class DisplayableEventFormatter @Inject constructor( | |
EventType.STICKER -> { | ||
simpleFormat(senderName, stringProvider.getString(R.string.send_a_sticker), appendAuthor) | ||
} | ||
EventType.REACTION -> { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This seems to be unused after my changes. |
||
timelineEvent.root.getClearContent().toModel<ReactionContent>()?.relatesTo?.let { | ||
val emojiSpanned = emojiSpanify.spanify(stringProvider.getString(R.string.sent_a_reaction, it.key)) | ||
simpleFormat(senderName, emojiSpanned, appendAuthor) | ||
} ?: span { } | ||
} | ||
EventType.KEY_VERIFICATION_CANCEL, | ||
EventType.KEY_VERIFICATION_DONE -> { | ||
// cancel and done can appear in timeline, so should have representation | ||
|
@@ -214,11 +205,6 @@ class DisplayableEventFormatter @Inject constructor( | |
EventType.STICKER -> { | ||
stringProvider.getString(R.string.send_a_sticker) | ||
} | ||
EventType.REACTION -> { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is the |
||
event.getClearContent().toModel<ReactionContent>()?.relatesTo?.let { | ||
emojiSpanify.spanify(stringProvider.getString(R.string.sent_a_reaction, it.key)) | ||
} ?: span { } | ||
} | ||
in EventType.POLL_START -> { | ||
event.getClearContent().toModel<MessagePollContent>(catchError = true)?.pollCreationInfo?.question?.question | ||
?: stringProvider.getString(R.string.sent_a_poll) | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would merge this PR if this was the only change (with the changelog). Let's do not touch
DisplayableEventFormatter.kt
andstrings.xml
, just in case this is added again (in the project or in a fork).