mirror of
https://github.com/vector-im/element-android.git
synced 2024-11-16 02:05:06 +08:00
- Remove counter from thread notifications
- Fix red dot on user mentioning
This commit is contained in:
parent
f53b711e0d
commit
554ece724e
@ -219,6 +219,13 @@ data class Event(
|
||||
return getDecryptedValue("formatted_body")?.contains("<blockquote>") ?: false
|
||||
}
|
||||
|
||||
/**
|
||||
* Determines whether or not current event has mentioned the user
|
||||
*/
|
||||
fun isUserMentioned(userId: String): Boolean {
|
||||
return getDecryptedValue("formatted_body")?.contains(userId) ?: false
|
||||
}
|
||||
|
||||
/**
|
||||
* Decrypt the message, or return the pure payload value if there is no encryption
|
||||
*/
|
||||
|
@ -210,8 +210,7 @@ internal fun findMyReadReceipt(realm: Realm, roomId: String, userId: String): St
|
||||
* Returns whether or not the user is mentioned in the event
|
||||
*/
|
||||
internal fun isUserMentioned(currentUserId: String, timelineEventEntity: TimelineEventEntity?): Boolean {
|
||||
val decryptedContent = timelineEventEntity?.root?.asDomain()?.getDecryptedTextSummary().orEmpty()
|
||||
return decryptedContent.contains(currentUserId.replace("@", "").substringBefore(":"))
|
||||
return timelineEventEntity?.root?.asDomain()?.isUserMentioned(currentUserId) == true
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -26,12 +26,11 @@
|
||||
<FrameLayout
|
||||
android:id="@+id/threadNotificationBadgeFrameLayout"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="15dp"
|
||||
android:minWidth="15dp"
|
||||
android:layout_height="9dp"
|
||||
android:minWidth="9dp"
|
||||
android:paddingStart="2dp"
|
||||
android:paddingEnd="2dp"
|
||||
android:layout_gravity="top|end"
|
||||
android:layout_marginTop="1dp"
|
||||
android:backgroundTint="@color/palette_gray_200"
|
||||
android:background="@drawable/notification_badge"
|
||||
android:visibility="visible"
|
||||
@ -47,6 +46,7 @@
|
||||
android:layout_gravity="center"
|
||||
android:textColor="@color/palette_white"
|
||||
android:maxLength="3"
|
||||
android:visibility="gone"
|
||||
android:textStyle="bold"
|
||||
android:textSize="10sp"
|
||||
tools:text="99" />
|
||||
|
Loading…
Reference in New Issue
Block a user