mirror of
https://github.com/Novaloop-AG/element-x-android.git
synced 2026-11-02 12:07:28 +00:00
Reduce API of JoinedRoom, caller must use the Timeline API from liveTimeline instead. (#4731)
This removes lots of boilerplate code.
This commit is contained in:
+1
-1
@@ -22,7 +22,7 @@ class DefaultEndPollAction @Inject constructor(
|
||||
private val analyticsService: AnalyticsService,
|
||||
) : EndPollAction {
|
||||
override suspend fun execute(pollStartId: EventId): Result<Unit> {
|
||||
return room.endPoll(
|
||||
return room.liveTimeline.endPoll(
|
||||
pollStartId = pollStartId,
|
||||
text = "The poll with event id: $pollStartId has ended."
|
||||
).onSuccess {
|
||||
|
||||
+1
-1
@@ -22,7 +22,7 @@ class DefaultSendPollResponseAction @Inject constructor(
|
||||
private val analyticsService: AnalyticsService,
|
||||
) : SendPollResponseAction {
|
||||
override suspend fun execute(pollStartId: EventId, answerId: String): Result<Unit> {
|
||||
return room.sendPollResponse(
|
||||
return room.liveTimeline.sendPollResponse(
|
||||
pollStartId = pollStartId,
|
||||
answers = listOf(answerId),
|
||||
).onSuccess {
|
||||
|
||||
+1
-1
@@ -41,7 +41,7 @@ class PollRepository @Inject constructor(
|
||||
pollKind: PollKind,
|
||||
maxSelections: Int,
|
||||
): Result<Unit> = when (existingPollId) {
|
||||
null -> room.createPoll(
|
||||
null -> room.liveTimeline.createPoll(
|
||||
question = question,
|
||||
answers = answers,
|
||||
maxSelections = maxSelections,
|
||||
|
||||
Reference in New Issue
Block a user