Receive calling reactions support and control ux refactor.

Co-authored-by: Nicholas <nicholas@signal.org>
This commit is contained in:
Cody Henthorne
2023-12-06 13:35:19 -05:00
parent 7ce2991b0f
commit a678555d8d
36 changed files with 1852 additions and 747 deletions

View File

@@ -47,6 +47,14 @@ data class CallParticipant constructor(
}
}
fun getRecipientDisplayNameDeviceAgnostic(context: Context): String {
return if (recipient.isSelf) {
context.getString(R.string.CallParticipant__you)
} else {
recipient.getDisplayName(context)
}
}
fun getShortRecipientDisplayName(context: Context): String {
return if (recipient.isSelf && isPrimary) {
context.getString(R.string.CallParticipant__you)

View File

@@ -0,0 +1,22 @@
/*
* Copyright 2023 Signal Messenger, LLC
* SPDX-License-Identifier: AGPL-3.0-only
*/
package org.thoughtcrime.securesms.events
import java.util.concurrent.TimeUnit
/**
* This is a data class to represent a reaction coming in over the wire in the format we need (mapped to a [CallParticipant]) in a way that can be easily
* compared across Rx streams.
*/
data class GroupCallReactionEvent(val sender: CallParticipant, val reaction: String, val timestamp: Long) {
fun getExpirationTimestamp(): Long {
return timestamp + TimeUnit.SECONDS.toMillis(LIFESPAN_SECONDS)
}
companion object {
const val LIFESPAN_SECONDS = 4L
}
}