mirror of
https://github.com/SchildiChat/SchildiChat-android.git
synced 2024-11-21 17:05:39 +03:00
Remove non necessary call when getting the targeted event id
This commit is contained in:
parent
bd91db66f8
commit
71df1e61d4
1 changed files with 2 additions and 3 deletions
|
@ -78,7 +78,7 @@ class DefaultPollAggregationProcessor @Inject constructor() : PollAggregationPro
|
|||
val content = event.getClearContent()?.toModel<MessagePollResponseContent>() ?: return false
|
||||
val roomId = event.roomId ?: return false
|
||||
val senderId = event.senderId ?: return false
|
||||
val targetEventId = (event.getRelationContent() ?: content.relatesTo)?.eventId ?: return false
|
||||
val targetEventId = event.getRelationContent()?.eventId ?: return false
|
||||
val targetPollContent = getPollContent(session, roomId, targetEventId) ?: return false
|
||||
|
||||
val annotationsSummaryEntity = getAnnotationsSummaryEntity(realm, roomId, targetEventId)
|
||||
|
@ -154,9 +154,8 @@ class DefaultPollAggregationProcessor @Inject constructor() : PollAggregationPro
|
|||
}
|
||||
|
||||
override fun handlePollEndEvent(session: Session, powerLevelsHelper: PowerLevelsHelper, realm: Realm, event: Event): Boolean {
|
||||
val content = event.getClearContent()?.toModel<MessageEndPollContent>() ?: return false
|
||||
val roomId = event.roomId ?: return false
|
||||
val pollEventId = (event.getRelationContent() ?: content.relatesTo)?.eventId ?: return false
|
||||
val pollEventId = event.getRelationContent()?.eventId ?: return false
|
||||
val pollOwnerId = getPollEvent(session, roomId, pollEventId)?.root?.senderId
|
||||
val isPollOwner = pollOwnerId == event.senderId
|
||||
|
||||
|
|
Loading…
Reference in a new issue