Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[stable-20.0] Bugfix/4272/fix to handle old server versions #4280

Merged
merged 2 commits into from
Sep 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -1745,9 +1745,8 @@ class CallActivity : CallBaseActivity() {
ApplicationWideCurrentRoomHolder.getInstance().callStartTime = conversation.callStartTime
}

private fun startCallTimeCounter(callStartTime: Long?) {
if (callStartTime != null &&
callStartTime != 0L &&
private fun startCallTimeCounter(callStartTime: Long) {
if (callStartTime != 0L &&
hasSpreedFeatureCapability(
conversationUser!!.capabilities!!.spreedCapability!!, SpreedFeatures.RECORDING_V1
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -356,8 +356,8 @@ class ConversationInfoActivity :
binding.webinarInfoView.startTimeButton.setOnClickListener {
MaterialDialog(this, BottomSheet(WRAP_CONTENT)).show {
val currentTimeCalendar = Calendar.getInstance()
if (conversation!!.lobbyTimer != null && conversation!!.lobbyTimer != 0L) {
currentTimeCalendar.timeInMillis = conversation!!.lobbyTimer!! * DateConstants.SECOND_DIVIDER
if (conversation!!.lobbyTimer != 0L) {
currentTimeCalendar.timeInMillis = conversation!!.lobbyTimer * DateConstants.SECOND_DIVIDER
}

dateTimePicker(
Expand Down Expand Up @@ -746,13 +746,13 @@ class ConversationInfoActivity :

setupWebinaryView()

if (!ConversationUtils.canLeave(conversation!!)) {
if (!conversation!!.canLeaveConversation) {
binding.leaveConversationAction.visibility = GONE
} else {
binding.leaveConversationAction.visibility = VISIBLE
}

if (!ConversationUtils.canDelete(conversation!!, spreedCapabilities)) {
if (!conversation!!.canDeleteConversation) {
binding.deleteConversationAction.visibility = GONE
} else {
binding.deleteConversationAction.visibility = VISIBLE
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -116,46 +116,46 @@ fun Conversation.asEntity(accountId: Long) =
ConversationEntity(
internalId = "$accountId@$token",
accountId = accountId,
token = token!!,
name = name!!,
displayName = displayName!!,
description = description!!,
type = type!!,
token = token,
name = name,
displayName = displayName,
description = description,
type = type,
lastPing = lastPing,
participantType = participantType!!,
participantType = participantType,
hasPassword = hasPassword,
sessionId = sessionId!!,
actorId = actorId!!,
actorType = actorType!!,
sessionId = sessionId,
actorId = actorId,
actorType = actorType,
favorite = favorite,
lastActivity = lastActivity,
unreadMessages = unreadMessages,
unreadMention = unreadMention,
lastMessage = lastMessage?.let { LoganSquare.serialize(lastMessage) },
objectType = objectType!!,
notificationLevel = notificationLevel!!,
conversationReadOnlyState = conversationReadOnlyState!!,
lobbyState = lobbyState!!,
lobbyTimer = lobbyTimer!!,
objectType = objectType,
notificationLevel = notificationLevel,
conversationReadOnlyState = conversationReadOnlyState,
lobbyState = lobbyState,
lobbyTimer = lobbyTimer,
lastReadMessage = lastReadMessage,
lastCommonReadMessage = lastCommonReadMessage,
hasCall = hasCall,
callFlag = callFlag,
canStartCall = canStartCall,
canLeaveConversation = canLeaveConversation!!,
canDeleteConversation = canDeleteConversation!!,
unreadMentionDirect = unreadMentionDirect!!,
notificationCalls = notificationCalls!!,
canLeaveConversation = canLeaveConversation,
canDeleteConversation = canDeleteConversation,
unreadMentionDirect = unreadMentionDirect,
notificationCalls = notificationCalls,
permissions = permissions,
messageExpiration = messageExpiration,
status = status,
statusIcon = statusIcon,
statusMessage = statusMessage,
statusClearAt = statusClearAt,
callRecording = callRecording,
avatarVersion = avatarVersion!!,
hasCustomAvatar = hasCustomAvatar!!,
callStartTime = callStartTime!!,
avatarVersion = avatarVersion,
hasCustomAvatar = hasCustomAvatar,
callStartTime = callStartTime,
recordingConsentRequired = recordingConsentRequired,
remoteServer = remoteServer,
remoteToken = remoteToken
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ import com.nextcloud.talk.models.json.participants.Participant
class ConversationModel(
var internalId: String,
var accountId: Long,
// var roomId: String? = null,
var token: String,
var name: String,
var displayName: String,
Expand Down Expand Up @@ -70,104 +69,59 @@ class ConversationModel(
return ConversationModel(
internalId = user.id!!.toString() + "@" + conversation.token,
accountId = user.id!!,
// roomId = conversation.roomId,
token = conversation.token!!,
name = conversation.name!!,
displayName = conversation.displayName!!,
description = conversation.description!!,
type = conversation.type.let { ConversationEnums.ConversationType.valueOf(it!!.name) },
token = conversation.token,
name = conversation.name,
displayName = conversation.displayName,
description = conversation.description,
type = conversation.type.let { ConversationEnums.ConversationType.valueOf(it.name) },
lastPing = conversation.lastPing,
participantType = conversation.participantType.let { Participant.ParticipantType.valueOf(it!!.name) },
participantType = conversation.participantType.let { Participant.ParticipantType.valueOf(it.name) },
hasPassword = conversation.hasPassword,
sessionId = conversation.sessionId!!,
actorId = conversation.actorId!!,
actorType = conversation.actorType!!,
sessionId = conversation.sessionId,
actorId = conversation.actorId,
actorType = conversation.actorType,
password = conversation.password,
favorite = conversation.favorite,
lastActivity = conversation.lastActivity,
unreadMessages = conversation.unreadMessages,
unreadMention = conversation.unreadMention,
lastMessage = conversation.lastMessage,
objectType = conversation.objectType.let { ConversationEnums.ObjectType.valueOf(it!!.name) },
objectType = conversation.objectType.let { ConversationEnums.ObjectType.valueOf(it.name) },
notificationLevel = conversation.notificationLevel.let {
ConversationEnums.NotificationLevel.valueOf(
it!!.name
it.name
)
},
conversationReadOnlyState = conversation.conversationReadOnlyState.let {
ConversationEnums.ConversationReadOnlyState.valueOf(
it!!.name
it.name
)
},
lobbyState = conversation.lobbyState.let { ConversationEnums.LobbyState.valueOf(it!!.name) },
lobbyTimer = conversation.lobbyTimer!!,
lobbyState = conversation.lobbyState.let { ConversationEnums.LobbyState.valueOf(it.name) },
lobbyTimer = conversation.lobbyTimer,
lastReadMessage = conversation.lastReadMessage,
lastCommonReadMessage = conversation.lastCommonReadMessage,
hasCall = conversation.hasCall,
callFlag = conversation.callFlag,
canStartCall = conversation.canStartCall,
canLeaveConversation = conversation.canLeaveConversation!!,
canDeleteConversation = conversation.canDeleteConversation!!,
unreadMentionDirect = conversation.unreadMentionDirect!!,
notificationCalls = conversation.notificationCalls!!,
canLeaveConversation = conversation.canLeaveConversation,
canDeleteConversation = conversation.canDeleteConversation,
unreadMentionDirect = conversation.unreadMentionDirect,
notificationCalls = conversation.notificationCalls,
permissions = conversation.permissions,
messageExpiration = conversation.messageExpiration,
status = conversation.status,
statusIcon = conversation.statusIcon,
statusMessage = conversation.statusMessage,
statusClearAt = conversation.statusClearAt,
callRecording = conversation.callRecording,
avatarVersion = conversation.avatarVersion!!,
hasCustomAvatar = conversation.hasCustomAvatar!!,
callStartTime = conversation.callStartTime!!,
avatarVersion = conversation.avatarVersion,
hasCustomAvatar = conversation.hasCustomAvatar,
callStartTime = conversation.callStartTime,
recordingConsentRequired = conversation.recordingConsentRequired,
remoteServer = conversation.remoteServer,
remoteToken = conversation.remoteToken
)
}
}
}

// enum class ConversationType {
// DUMMY,
// ROOM_TYPE_ONE_TO_ONE_CALL,
// ROOM_GROUP_CALL,
// ROOM_PUBLIC_CALL,
// ROOM_SYSTEM,
// FORMER_ONE_TO_ONE,
// NOTE_TO_SELF
// }
//
// enum class ParticipantType {
// DUMMY,
// OWNER,
// MODERATOR,
// USER,
// GUEST,
// USER_FOLLOWING_LINK,
// GUEST_MODERATOR
// }
//
// enum class ObjectType {
// DEFAULT,
// SHARE_PASSWORD,
// FILE,
// ROOM
// }
//
// enum class NotificationLevel {
// DEFAULT,
// ALWAYS,
// MENTION,
// NEVER
// }
//
// enum class ConversationReadOnlyState {
// CONVERSATION_READ_WRITE,
// CONVERSATION_READ_ONLY
// }
//
// enum class LobbyState {
// LOBBY_STATE_ALL_PARTICIPANTS,
// LOBBY_STATE_MODERATORS_ONLY
// }
Loading
Loading