Skip to content

Commit d1ce15b

Browse files
committed
Renaming field in PollResponseData for better clarity
1 parent 94dd599 commit d1ce15b

File tree

4 files changed

+6
-6
lines changed

4 files changed

+6
-6
lines changed

vector/src/main/java/im/vector/app/features/home/room/detail/timeline/factory/PollItemViewStateFactory.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ class PollItemViewStateFactory @Inject constructor(
8383
totalVotes: Int,
8484
winnerVoteCount: Int?,
8585
): PollViewState {
86-
val totalVotesText = if (pollResponseSummary?.hasDecryptionError.orFalse()) {
86+
val totalVotesText = if (pollResponseSummary?.hasEncryptedRelatedEvents.orFalse()) {
8787
stringProvider.getString(R.string.unable_to_decrypt_some_events_in_poll)
8888
} else {
8989
stringProvider.getQuantityString(R.plurals.poll_total_vote_count_after_ended, totalVotes, totalVotes)
@@ -131,7 +131,7 @@ class PollItemViewStateFactory @Inject constructor(
131131
pollResponseSummary: PollResponseData?,
132132
totalVotes: Int
133133
): PollViewState {
134-
val totalVotesText = if (pollResponseSummary?.hasDecryptionError.orFalse()) {
134+
val totalVotesText = if (pollResponseSummary?.hasEncryptedRelatedEvents.orFalse()) {
135135
stringProvider.getString(R.string.unable_to_decrypt_some_events_in_poll)
136136
} else {
137137
stringProvider.getQuantityString(R.plurals.poll_total_vote_count_before_ended_and_voted, totalVotes, totalVotes)

vector/src/main/java/im/vector/app/features/home/room/detail/timeline/helper/PollResponseDataFactory.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ class PollResponseDataFactory @Inject constructor(
4545
},
4646
winnerVoteCount = it.aggregatedContent?.winnerVoteCount ?: 0,
4747
totalVotes = it.aggregatedContent?.totalVotes ?: 0,
48-
hasDecryptionError = it.encryptedRelatedEventIds.isNotEmpty(),
48+
hasEncryptedRelatedEvents = it.encryptedRelatedEventIds.isNotEmpty(),
4949
)
5050
}
5151
}

vector/src/main/java/im/vector/app/features/home/room/detail/timeline/item/MessageInformationData.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ data class PollResponseData(
9191
val totalVotes: Int = 0,
9292
val winnerVoteCount: Int = 0,
9393
val isClosed: Boolean = false,
94-
val hasDecryptionError: Boolean = false,
94+
val hasEncryptedRelatedEvents: Boolean = false,
9595
) : Parcelable {
9696

9797
fun getVoteSummaryOfAnOption(optionId: String) = votes?.get(optionId)

vector/src/test/java/im/vector/app/features/home/room/detail/timeline/factory/PollItemViewStateFactoryTest.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ class PollItemViewStateFactoryTest {
136136
// Given
137137
val stringProvider = FakeStringProvider()
138138
val pollItemViewStateFactory = PollItemViewStateFactory(stringProvider.instance)
139-
val closedPollSummary = A_POLL_RESPONSE_DATA.copy(isClosed = true, hasDecryptionError = true)
139+
val closedPollSummary = A_POLL_RESPONSE_DATA.copy(isClosed = true, hasEncryptedRelatedEvents = true)
140140
val closedPollInformationData = A_MESSAGE_INFORMATION_DATA.copy(pollResponseAggregatedSummary = closedPollSummary)
141141

142142
// When
@@ -220,7 +220,7 @@ class PollItemViewStateFactoryTest {
220220
totalVotes = 1,
221221
myVote = A_POLL_OPTION_IDS[0],
222222
votes = mapOf(A_POLL_OPTION_IDS[0] to PollVoteSummaryData(total = 1, percentage = 1.0)),
223-
hasDecryptionError = true,
223+
hasEncryptedRelatedEvents = true,
224224
)
225225
val disclosedPollContent = A_POLL_CONTENT.copy(
226226
unstablePollCreationInfo = A_POLL_CONTENT.getBestPollCreationInfo()?.copy(

0 commit comments

Comments
 (0)