Skip to content
Snippets Groups Projects
Commit 40730eca authored by Taras's avatar Taras
Browse files

Add isEventRead for user

parent d84313f3
No related branches found
No related tags found
No related merge requests found
...@@ -51,6 +51,9 @@ interface ReadService { ...@@ -51,6 +51,9 @@ interface ReadService {
*/ */
fun isEventRead(eventId: String): Boolean fun isEventRead(eventId: String): Boolean
//Added for viewers count
fun isEventRead(eventId: String, userId: String): Boolean
/** /**
* Returns a live read marker id for the room. * Returns a live read marker id for the room.
*/ */
......
...@@ -71,6 +71,10 @@ internal class DefaultReadService @AssistedInject constructor( ...@@ -71,6 +71,10 @@ internal class DefaultReadService @AssistedInject constructor(
return isEventRead(monarchy.realmConfiguration, userId, roomId, eventId) return isEventRead(monarchy.realmConfiguration, userId, roomId, eventId)
} }
override fun isEventRead(eventId: String, userId: String): Boolean {
return isEventRead(monarchy.realmConfiguration, userId, roomId, eventId)
}
override fun getReadMarkerLive(): LiveData<Optional<String>> { override fun getReadMarkerLive(): LiveData<Optional<String>> {
val liveRealmData = monarchy.findAllMappedWithChanges( val liveRealmData = monarchy.findAllMappedWithChanges(
{ ReadMarkerEntity.where(it, roomId) }, { ReadMarkerEntity.where(it, roomId) },
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment