mirror of
https://gitlab.linphone.org/BC/public/linphone-android.git
synced 2026-01-17 03:18:06 +00:00
Various improvements
This commit is contained in:
parent
2bd0de4af1
commit
ae39d79420
5 changed files with 35 additions and 38 deletions
|
|
@ -36,7 +36,7 @@ Linphone is dual licensed, and is available either :
|
||||||
|
|
||||||
6.0.0 release is a completely new version, designed with UX/UI experts and marks a turning point in design, features, and user experience. The improvements make this version smoother and simpler for both developers and users.
|
6.0.0 release is a completely new version, designed with UX/UI experts and marks a turning point in design, features, and user experience. The improvements make this version smoother and simpler for both developers and users.
|
||||||
|
|
||||||
You can take a look at the [CHANGELOG.md](CHANGELOG.md) file for a non-exhaustive list of changes of this new version and of the newly added features, the most exciting ones being the improved fluidity, a real multi-accounts support and asymetrical video in calls.
|
You can take a look at the [CHANGELOG.md](CHANGELOG.md) file for a non-exhaustive list of changes of this new version and of the newly added features, the most exciting ones being the improved fluidity, a real multi-accounts support and asymmetrical video in calls.
|
||||||
|
|
||||||
This release only works on Android OS 9.0 and newer.
|
This release only works on Android OS 9.0 and newer.
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -107,6 +107,7 @@ class ConversationModel
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@WorkerThread
|
||||||
override fun onConferenceJoined(chatRoom: ChatRoom, eventLog: EventLog) {
|
override fun onConferenceJoined(chatRoom: ChatRoom, eventLog: EventLog) {
|
||||||
// This is required as a Created chat room may not have the participants list yet
|
// This is required as a Created chat room may not have the participants list yet
|
||||||
Log.i("$TAG Conversation has been joined")
|
Log.i("$TAG Conversation has been joined")
|
||||||
|
|
@ -129,10 +130,12 @@ class ConversationModel
|
||||||
computeComposingLabel()
|
computeComposingLabel()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@WorkerThread
|
||||||
override fun onNewEvent(chatRoom: ChatRoom, eventLog: EventLog) {
|
override fun onNewEvent(chatRoom: ChatRoom, eventLog: EventLog) {
|
||||||
updateLastUpdatedTime()
|
updateLastUpdatedTime()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@WorkerThread
|
||||||
override fun onNewEvents(chatRoom: ChatRoom, eventLogs: Array<out EventLog>) {
|
override fun onNewEvents(chatRoom: ChatRoom, eventLogs: Array<out EventLog>) {
|
||||||
updateLastMessage()
|
updateLastMessage()
|
||||||
updateLastUpdatedTime()
|
updateLastUpdatedTime()
|
||||||
|
|
@ -340,14 +343,13 @@ class ConversationModel
|
||||||
|
|
||||||
val message = chatRoom.lastMessageInHistory
|
val message = chatRoom.lastMessageInHistory
|
||||||
if (message != null) {
|
if (message != null) {
|
||||||
|
lastMessage = message
|
||||||
updateLastMessageStatus(message)
|
updateLastMessageStatus(message)
|
||||||
|
|
||||||
if (message.isOutgoing && message.state != ChatMessage.State.Displayed) {
|
if (message.isOutgoing && message.state != ChatMessage.State.Displayed) {
|
||||||
message.addListener(chatMessageListener)
|
message.addListener(chatMessageListener)
|
||||||
lastMessage = message
|
|
||||||
} else if (message.contents.find { it.isFileTransfer == true } != null) {
|
} else if (message.contents.find { it.isFileTransfer == true } != null) {
|
||||||
message.addListener(chatMessageListener)
|
message.addListener(chatMessageListener)
|
||||||
lastMessage = message
|
|
||||||
}
|
}
|
||||||
|
|
||||||
val timestamp = message.time
|
val timestamp = message.time
|
||||||
|
|
|
||||||
|
|
@ -20,10 +20,7 @@
|
||||||
package org.linphone.ui.main.chat.model
|
package org.linphone.ui.main.chat.model
|
||||||
|
|
||||||
import androidx.annotation.WorkerThread
|
import androidx.annotation.WorkerThread
|
||||||
import org.linphone.LinphoneApplication.Companion.coreContext
|
|
||||||
import org.linphone.core.EventLog
|
import org.linphone.core.EventLog
|
||||||
import org.linphone.core.tools.Log
|
|
||||||
import org.linphone.utils.LinphoneUtils
|
|
||||||
|
|
||||||
class EventLogModel
|
class EventLogModel
|
||||||
@WorkerThread
|
@WorkerThread
|
||||||
|
|
@ -54,35 +51,10 @@ class EventLogModel
|
||||||
EventModel(eventLog)
|
EventModel(eventLog)
|
||||||
} else {
|
} else {
|
||||||
val chatMessage = eventLog.chatMessage!!
|
val chatMessage = eventLog.chatMessage!!
|
||||||
var replyTo = ""
|
|
||||||
var isReply = chatMessage.isReply
|
|
||||||
val replyText = if (chatMessage.isReply) {
|
|
||||||
val replyMessage = chatMessage.replyMessage
|
|
||||||
if (replyMessage != null) {
|
|
||||||
val from = replyMessage.fromAddress
|
|
||||||
val avatarModel = coreContext.contactsManager.getContactAvatarModelForAddress(from)
|
|
||||||
replyTo = avatarModel.contactName ?: LinphoneUtils.getDisplayName(from)
|
|
||||||
|
|
||||||
LinphoneUtils.getPlainTextDescribingMessage(replyMessage)
|
|
||||||
} else {
|
|
||||||
Log.e(
|
|
||||||
"$TAG Failed to find the reply message from ID [${chatMessage.replyMessageId}]"
|
|
||||||
)
|
|
||||||
isReply = false
|
|
||||||
""
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
""
|
|
||||||
}
|
|
||||||
|
|
||||||
MessageModel(
|
MessageModel(
|
||||||
chatMessage,
|
chatMessage,
|
||||||
isFromGroup,
|
isFromGroup,
|
||||||
isReply,
|
|
||||||
replyTo,
|
|
||||||
replyText,
|
|
||||||
chatMessage.replyMessageId,
|
|
||||||
chatMessage.isForward,
|
|
||||||
isGroupedWithPreviousOne,
|
isGroupedWithPreviousOne,
|
||||||
isGroupedWithNextOne,
|
isGroupedWithNextOne,
|
||||||
currentFilter,
|
currentFilter,
|
||||||
|
|
|
||||||
|
|
@ -70,11 +70,6 @@ class MessageModel
|
||||||
constructor(
|
constructor(
|
||||||
val chatMessage: ChatMessage,
|
val chatMessage: ChatMessage,
|
||||||
val isFromGroup: Boolean,
|
val isFromGroup: Boolean,
|
||||||
val isReply: Boolean,
|
|
||||||
val replyTo: String,
|
|
||||||
val replyText: String,
|
|
||||||
val replyToMessageId: String?,
|
|
||||||
val isForward: Boolean,
|
|
||||||
isGroupedWithPreviousOne: Boolean,
|
isGroupedWithPreviousOne: Boolean,
|
||||||
isGroupedWithNextOne: Boolean,
|
isGroupedWithNextOne: Boolean,
|
||||||
private val currentFilter: String = "",
|
private val currentFilter: String = "",
|
||||||
|
|
@ -116,6 +111,16 @@ class MessageModel
|
||||||
)?.params?.instantMessagingEncryptionMandatory == true
|
)?.params?.instantMessagingEncryptionMandatory == true
|
||||||
)
|
)
|
||||||
|
|
||||||
|
val isReply = chatMessage.isReply
|
||||||
|
|
||||||
|
val replyToMessageId = chatMessage.replyMessageId
|
||||||
|
|
||||||
|
val isForward = chatMessage.isForward
|
||||||
|
|
||||||
|
val replyTo = MutableLiveData<String>()
|
||||||
|
|
||||||
|
val replyText = MutableLiveData<Spannable>()
|
||||||
|
|
||||||
val avatarModel = MutableLiveData<ContactAvatarModel>()
|
val avatarModel = MutableLiveData<ContactAvatarModel>()
|
||||||
|
|
||||||
val groupedWithNextMessage = MutableLiveData<Boolean>()
|
val groupedWithNextMessage = MutableLiveData<Boolean>()
|
||||||
|
|
@ -314,6 +319,9 @@ class MessageModel
|
||||||
updateReactionsList()
|
updateReactionsList()
|
||||||
|
|
||||||
computeContentsList()
|
computeContentsList()
|
||||||
|
if (isReply) {
|
||||||
|
computeReplyInfo()
|
||||||
|
}
|
||||||
|
|
||||||
coreContext.postOnMainThread {
|
coreContext.postOnMainThread {
|
||||||
firstFileModel.addSource(filesList) {
|
firstFileModel.addSource(filesList) {
|
||||||
|
|
@ -629,6 +637,19 @@ class MessageModel
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@WorkerThread
|
||||||
|
fun computeReplyInfo() {
|
||||||
|
val replyMessage = chatMessage.replyMessage
|
||||||
|
if (replyMessage != null) {
|
||||||
|
val from = replyMessage.fromAddress
|
||||||
|
val avatarModel = coreContext.contactsManager.getContactAvatarModelForAddress(from)
|
||||||
|
replyTo.postValue(avatarModel.contactName ?: LinphoneUtils.getDisplayName(from))
|
||||||
|
replyText.postValue(LinphoneUtils.getFormattedTextDescribingMessage(replyMessage))
|
||||||
|
} else {
|
||||||
|
Log.e("$TAG Failed to find the reply message from ID [${chatMessage.replyMessageId}]")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@WorkerThread
|
@WorkerThread
|
||||||
private fun computeTextContent(content: Content, highlight: String) {
|
private fun computeTextContent(content: Content, highlight: String) {
|
||||||
val textContent = content.utf8Text.orEmpty().trim()
|
val textContent = content.utf8Text.orEmpty().trim()
|
||||||
|
|
|
||||||
|
|
@ -139,7 +139,8 @@
|
||||||
<View
|
<View
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="1dp"
|
android:layout_height="1dp"
|
||||||
android:background="?attr/color_separator"/>
|
android:background="?attr/color_separator"
|
||||||
|
android:visibility="@{viewModel.isChatRoomReadOnly ? View.GONE : View.VISIBLE}" />
|
||||||
|
|
||||||
<androidx.appcompat.widget.AppCompatTextView
|
<androidx.appcompat.widget.AppCompatTextView
|
||||||
style="@style/popup_menu_action_label_style"
|
style="@style/popup_menu_action_label_style"
|
||||||
|
|
@ -170,7 +171,8 @@
|
||||||
<View
|
<View
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="1dp"
|
android:layout_height="1dp"
|
||||||
android:background="?attr/color_separator"/>
|
android:background="?attr/color_separator"
|
||||||
|
android:visibility="@{viewModel.hideForward ? View.GONE : View.VISIBLE}" />
|
||||||
|
|
||||||
<androidx.appcompat.widget.AppCompatTextView
|
<androidx.appcompat.widget.AppCompatTextView
|
||||||
style="@style/popup_menu_danger_action_label_style"
|
style="@style/popup_menu_danger_action_label_style"
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue