mirror of
https://github.com/nextcloud/talk-android
synced 2025-06-20 12:09:45 +01:00
format code
Signed-off-by: sowjanyakch <sowjanya.kch@gmail.com>
This commit is contained in:
parent
27538a77ff
commit
a9168b3f9d
@ -204,6 +204,4 @@ interface NcApiCoroutines {
|
||||
@Header("Authorization") authorization: String,
|
||||
@Url url: String
|
||||
): UserAbsenceOverall
|
||||
|
||||
|
||||
}
|
||||
|
@ -618,9 +618,14 @@ class ChatActivity :
|
||||
)
|
||||
|
||||
if (currentConversation?.type == ConversationEnums.ConversationType.ROOM_TYPE_ONE_TO_ONE_CALL &&
|
||||
currentConversation?.status == "dnd"){
|
||||
currentConversation?.status == "dnd"
|
||||
) {
|
||||
conversationUser?.let { user ->
|
||||
chatViewModel.outOfOfficeStatusOfUser(credentials, user.baseUrl!!, currentConversation!!.name)
|
||||
chatViewModel.outOfOfficeStatusOfUser(
|
||||
credentials,
|
||||
user.baseUrl!!,
|
||||
currentConversation!!.name
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
@ -698,8 +703,11 @@ class ChatActivity :
|
||||
if (currentConversation?.type == ConversationEnums.ConversationType.ROOM_TYPE_ONE_TO_ONE_CALL) {
|
||||
conversationUser?.let { user ->
|
||||
val credentials = ApiUtils.getCredentials(user.username, user.token)
|
||||
chatViewModel.outOfOfficeStatusOfUser(credentials!!, user.baseUrl!!,
|
||||
currentConversation!!.displayName)
|
||||
chatViewModel.outOfOfficeStatusOfUser(
|
||||
credentials!!,
|
||||
user.baseUrl!!,
|
||||
currentConversation!!.displayName
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
@ -1074,15 +1082,12 @@ class ChatActivity :
|
||||
when (uiState) {
|
||||
is ChatViewModel.OutOfOfficeUIState.Error -> {
|
||||
Log.e(TAG, "Error in outOfOfficeState", uiState.exception)
|
||||
|
||||
}
|
||||
ChatViewModel.OutOfOfficeUIState.None -> {
|
||||
|
||||
}
|
||||
is ChatViewModel.OutOfOfficeUIState.Success -> {
|
||||
binding.outOfOfficeContainer.visibility = View.VISIBLE
|
||||
|
||||
|
||||
val startDateTimestamp: Long = uiState.userAbsence.startDate.toLong()
|
||||
val endDateTimestamp: Long = uiState.userAbsence.endDate.toLong()
|
||||
|
||||
@ -1114,7 +1119,6 @@ class ChatActivity :
|
||||
binding.outOfOfficeContainer.findViewById<TextView>(R.id.userAbsencePeriod).text = "$startDateString - $endDateString"
|
||||
}
|
||||
|
||||
|
||||
if (uiState.userAbsence.replacementUserDisplayName != null) {
|
||||
binding.outOfOfficeContainer.findViewById<TextView>(R.id.absenceReplacement).text = String.format(
|
||||
context.resources.getString(R.string.user_absence_replacement),
|
||||
@ -1126,7 +1130,6 @@ class ChatActivity :
|
||||
binding.outOfOfficeContainer.findViewById<TextView>(R.id.userAbsenceLongMessage).text = uiState.userAbsence.message
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@ -3950,4 +3953,3 @@ class ChatActivity :
|
||||
const val NO_OFFLINE_MESSAGES_FOUND = "NO_OFFLINE_MESSAGES_FOUND"
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -65,5 +65,4 @@ interface ChatNetworkDataSource {
|
||||
fun setChatReadMarker(credentials: String, url: String, previousMessageId: Int): Observable<GenericOverall>
|
||||
fun editChatMessage(credentials: String, url: String, text: String): Observable<ChatOverallSingleMessage>
|
||||
suspend fun getOutOfOfficeStatusForUser(credentials: String, baseUrl: String, userId: String): UserAbsenceOverall
|
||||
|
||||
}
|
||||
|
@ -181,9 +181,14 @@ class RetrofitChatNetwork(private val ncApi: NcApi, private val ncApiCoroutines:
|
||||
return ncApi.editChatMessage(credentials, url, text).map { it }
|
||||
}
|
||||
|
||||
override suspend fun getOutOfOfficeStatusForUser(credentials: String, baseUrl: String, userId:String):
|
||||
UserAbsenceOverall {
|
||||
return ncApiCoroutines.getOutOfOfficeStatusForUser(credentials,
|
||||
ApiUtils.getUrlForOutOfOffice(baseUrl,userId))
|
||||
override suspend fun getOutOfOfficeStatusForUser(
|
||||
credentials: String,
|
||||
baseUrl: String,
|
||||
userId: String
|
||||
): UserAbsenceOverall {
|
||||
return ncApiCoroutines.getOutOfOfficeStatusForUser(
|
||||
credentials,
|
||||
ApiUtils.getUrlForOutOfOffice(baseUrl, userId)
|
||||
)
|
||||
}
|
||||
}
|
||||
|
@ -787,7 +787,6 @@ class ChatViewModel @Inject constructor(
|
||||
const val JOIN_ROOM_RETRY_COUNT: Long = 3
|
||||
}
|
||||
|
||||
|
||||
sealed class OutOfOfficeUIState {
|
||||
data object None : OutOfOfficeUIState()
|
||||
data class Success(val userAbsence: UserAbsenceData) : OutOfOfficeUIState()
|
||||
|
@ -30,7 +30,7 @@ data class UserAbsenceData(
|
||||
@JsonField(name = ["replacementUserId"])
|
||||
var replacementUserId: String?,
|
||||
@JsonField(name = ["replacementUserDisplayName"])
|
||||
var replacementUserDisplayName: String?,
|
||||
var replacementUserDisplayName: String?
|
||||
) : Parcelable {
|
||||
// This constructor is added to work with the 'com.bluelinelabs.logansquare.annotation.JsonObject'
|
||||
constructor() :
|
||||
|
@ -24,4 +24,3 @@ data class UserAbsenceOCS(
|
||||
// This constructor is added to work with the 'com.bluelinelabs.logansquare.annotation.JsonObject'
|
||||
constructor() : this(null, null)
|
||||
}
|
||||
|
||||
|
@ -21,4 +21,3 @@ data class UserAbsenceOverall(
|
||||
// This constructor is added to work with the 'com.bluelinelabs.logansquare.annotation.JsonObject'
|
||||
constructor() : this(null)
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user