Fix issues on Notification Event resolver

This commit is contained in:
Valere
2019-06-22 17:08:45 +02:00
committed by Benoit Marty
parent 6743dc6273
commit 4e6b34b9d1
11 changed files with 151 additions and 131 deletions

View File

@ -47,6 +47,8 @@ interface Room :
* A live [RoomSummary] associated with the room
* You can observe this summary to get dynamic data from this room.
*/
val roomSummary: LiveData<RoomSummary>
val liveRoomSummary: LiveData<RoomSummary>
val roomSummary: RoomSummary?
}

View File

@ -39,4 +39,6 @@ data class CallInviteContent(
}
}
fun isVideo(): Boolean = offer.sdp.contains(Offer.SDP_VIDEO)
}

View File

@ -52,7 +52,7 @@ internal class DefaultRoom(
RelationService by relationService,
MembershipService by roomMembersService {
override val roomSummary: LiveData<RoomSummary> by lazy {
override val liveRoomSummary: LiveData<RoomSummary> by lazy {
val liveRealmData = RealmLiveData<RoomSummaryEntity>(monarchy.realmConfiguration) { realm ->
RoomSummaryEntity.where(realm, roomId).isNotEmpty(RoomSummaryEntityFields.DISPLAY_NAME)
}
@ -68,6 +68,15 @@ internal class DefaultRoom(
}
}
override val roomSummary: RoomSummary?
get() {
var sum: RoomSummaryEntity? = null
monarchy.runTransactionSync {
sum = RoomSummaryEntity.where(it, roomId).isNotEmpty(RoomSummaryEntityFields.DISPLAY_NAME).findFirst()
}
return sum?.asDomain()
}
override fun isEncrypted(): Boolean {
return cryptoService.isRoomEncrypted(roomId)
}

View File

@ -175,7 +175,10 @@ class PushrulesConditionTest {
return _numberOfJoinedMembers
}
override val roomSummary: LiveData<RoomSummary>
override val liveRoomSummary: LiveData<RoomSummary>
get() = TODO("not implemented") //To change initializer of created properties use File | Settings | File Templates.
override val roomSummary: RoomSummary?
get() = TODO("not implemented") //To change initializer of created properties use File | Settings | File Templates.
override fun createTimeline(eventId: String?, allowedTypes: List<String>?): Timeline {