Add missing header for avatar mouse shortcut in chats.

Add transfer icon in forward menu.
Confirmation on forward messages.
Fix forward button on search bar in chat room selection.
Revert back friends capability checks on lime.
Update SDK to 5.2.92
This commit is contained in:
Julien Wadel 2023-07-20 14:05:17 +02:00
parent 6f446c3c76
commit 2fa490e2ef
32 changed files with 185 additions and 35 deletions

View file

@ -11,6 +11,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Bubble chat layout.
- Camera stickers and conference layout stabilization.
- Robot voice with some devices (SDK fix).
- Crash after adding an account (SDK fix).
- Smart search bar behavior on empty text and focus changing.
### Added
@ -36,7 +37,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Display video thumbnails.
- Crop thumbnail and pictures if distored.
- Enable registration from accounts list.
- Update SDK to 5.2.90
- Update SDK to 5.2.92
### Removed
- Picture zoom on mouse over.

View file

@ -548,6 +548,11 @@
<source>newMessagePlaceholder</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>confirmForward</source>
<extracomment>&apos;Do you want to forward this message?&apos; : text to confirm to forward a message</extracomment>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>ChatCalendarMessage</name>

View file

@ -548,6 +548,11 @@ Server url ikke konfigureret.</translation>
<source>conferencesCopiedICS</source>
<translation>Samtales ICS er kopieret</translation>
</message>
<message>
<source>confirmForward</source>
<extracomment>&apos;Do you want to forward this message?&apos; : text to confirm to forward a message</extracomment>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>ChatCalendarMessage</name>

View file

@ -548,6 +548,11 @@ Server URL ist nicht konfiguriert.</translation>
<source>conferencesCopiedICS</source>
<translation>Die Einladung wurde kopiert</translation>
</message>
<message>
<source>confirmForward</source>
<extracomment>&apos;Do you want to forward this message?&apos; : text to confirm to forward a message</extracomment>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>ChatCalendarMessage</name>

View file

@ -548,6 +548,11 @@ Server URL not configured.</translation>
<source>conferencesCopiedICS</source>
<translation>The invitation has been copied</translation>
</message>
<message>
<source>confirmForward</source>
<extracomment>&apos;Do you want to forward this message?&apos; : text to confirm to forward a message</extracomment>
<translation>Do you want to forward this message?</translation>
</message>
</context>
<context>
<name>ChatCalendarMessage</name>
@ -996,7 +1001,7 @@ Server URL not configured.</translation>
<message>
<source>usernames</source>
<extracomment>&apos;USERNAME(S)&apos; : label for sip accounts when only username is displayed n contact</extracomment>
<translation type="unfinished"></translation>
<translation>USERNAMES(S)</translation>
</message>
</context>
<context>

View file

@ -548,6 +548,11 @@ URL del servidor no configurada.</translation>
<source>conferencesCopiedICS</source>
<translation>La conferencia ICS ha sido copiada</translation>
</message>
<message>
<source>confirmForward</source>
<extracomment>&apos;Do you want to forward this message?&apos; : text to confirm to forward a message</extracomment>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>ChatCalendarMessage</name>

View file

@ -548,6 +548,11 @@ URL du serveur non configurée.</translation>
<source>conferencesCopiedICS</source>
<translation>L&apos;invitation a é copiée</translation>
</message>
<message>
<source>confirmForward</source>
<extracomment>&apos;Do you want to forward this message?&apos; : text to confirm to forward a message</extracomment>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>ChatCalendarMessage</name>

View file

@ -547,6 +547,11 @@ A kiszolgáló URL-je nincs konfigurálva.</translation>
<source>conferencesCopiedICS</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>confirmForward</source>
<extracomment>&apos;Do you want to forward this message?&apos; : text to confirm to forward a message</extracomment>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>ChatCalendarMessage</name>

View file

@ -548,6 +548,11 @@ URL del server non configurato.</translation>
<source>conferencesCopiedICS</source>
<translation>L&apos;invito è stato copiato</translation>
</message>
<message>
<source>confirmForward</source>
<extracomment>&apos;Do you want to forward this message?&apos; : text to confirm to forward a message</extracomment>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>ChatCalendarMessage</name>

View file

@ -547,6 +547,11 @@
<source>conferencesCopiedICS</source>
<translation></translation>
</message>
<message>
<source>confirmForward</source>
<extracomment>&apos;Do you want to forward this message?&apos; : text to confirm to forward a message</extracomment>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>ChatCalendarMessage</name>

View file

@ -549,6 +549,11 @@ Nesukonfigūruotas serverio url.</translation>
<source>conferencesCopiedICS</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>confirmForward</source>
<extracomment>&apos;Do you want to forward this message?&apos; : text to confirm to forward a message</extracomment>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>ChatCalendarMessage</name>

View file

@ -548,6 +548,11 @@ URL do servidor não configurado.</translation>
<source>conferencesCopiedICS</source>
<translation>O convite foi copiado</translation>
</message>
<message>
<source>confirmForward</source>
<extracomment>&apos;Do you want to forward this message?&apos; : text to confirm to forward a message</extracomment>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>ChatCalendarMessage</name>

View file

@ -549,6 +549,11 @@
<source>conferencesCopiedICS</source>
<translation>Приглашение было скопировано</translation>
</message>
<message>
<source>confirmForward</source>
<extracomment>&apos;Do you want to forward this message?&apos; : text to confirm to forward a message</extracomment>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>ChatCalendarMessage</name>

View file

@ -548,6 +548,11 @@ Serverwebbadressen är inte konfigurerad.</translation>
<source>conferencesCopiedICS</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>confirmForward</source>
<extracomment>&apos;Do you want to forward this message?&apos; : text to confirm to forward a message</extracomment>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>ChatCalendarMessage</name>

View file

@ -547,6 +547,11 @@ Sunucu url&apos;si yapılandırılmadı.</translation>
<source>conferencesCopiedICS</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>confirmForward</source>
<extracomment>&apos;Do you want to forward this message?&apos; : text to confirm to forward a message</extracomment>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>ChatCalendarMessage</name>

View file

@ -549,6 +549,11 @@
<source>conferencesCopiedICS</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>confirmForward</source>
<extracomment>&apos;Do you want to forward this message?&apos; : text to confirm to forward a message</extracomment>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>ChatCalendarMessage</name>

View file

@ -547,6 +547,11 @@
<source>conferencesCopiedICS</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>confirmForward</source>
<extracomment>&apos;Do you want to forward this message?&apos; : text to confirm to forward a message</extracomment>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>ChatCalendarMessage</name>

View file

@ -319,7 +319,10 @@ void CoreManager::migrate () {
shared_ptr<linphone::Config> config = mCore->getConfig();
auto oldLimeServerUrl = mCore->getLimeX3DhServerUrl();// core url is deprecated : If core url exists, it must be copied to all linphone accounts.
int rcVersion = config->getInt(SettingsModel::UiSection, Constants::RcVersionName, 0);
if (oldLimeServerUrl.empty() && rcVersion == Constants::RcVersionCurrent)
if( !oldLimeServerUrl.empty()) {
mCore->setLimeX3DhServerUrl("");
mCore->enableLimeX3Dh(true);
}else if( rcVersion == Constants::RcVersionCurrent)
return;
if (rcVersion > Constants::RcVersionCurrent) {
qWarning() << QStringLiteral("RC file version (%1) is more recent than app rc file version (%2)!!!")
@ -329,10 +332,6 @@ void CoreManager::migrate () {
qInfo() << QStringLiteral("Migrate from old rc file (%1 to %2).")
.arg(rcVersion).arg(Constants::RcVersionCurrent);
if( !oldLimeServerUrl.empty()) {
mCore->setLimeX3DhServerUrl("");
mCore->enableLimeX3Dh(true);
}
bool setLimeServerUrl = false;
for(const auto &account : getAccountList()){
auto params = account->getParams();

View file

@ -95,13 +95,13 @@ char *Utils::rstrstr (const char *a, const char *b) {
// -----------------------------------------------------------------------------
bool Utils::hasCapability(const QString& address, const LinphoneEnums::FriendCapability& capability){
bool Utils::hasCapability(const QString& address, const LinphoneEnums::FriendCapability& capability, bool defaultCapability){
auto addressCleaned = cleanSipAddress(address);
auto contact = CoreManager::getInstance()->getContactsListModel()->findContactModelFromSipAddress(addressCleaned);
if(contact)
return contact->hasCapability(capability);
else
return false;
return defaultCapability;
}
QDateTime Utils::addMinutes(QDateTime date, const int& min){

View file

@ -63,7 +63,7 @@ public:
Q_ENUM(SipDisplayMode)
// Qt interfaces
Q_INVOKABLE static bool hasCapability(const QString& address, const LinphoneEnums::FriendCapability& capability);
Q_INVOKABLE static bool hasCapability(const QString& address, const LinphoneEnums::FriendCapability& capability, bool defaultCapability = true);
Q_INVOKABLE static QDateTime addMinutes(QDateTime date, const int& min);
static QDateTime getOffsettedUTC(const QDateTime& date);
Q_INVOKABLE static QString toDateTimeString(QDateTime date);

View file

@ -26,6 +26,8 @@
.import Linphone 1.0 as Linphone
.import UtilsCpp 1.0 as UtilsCpp
.import 'qrc:/ui/scripts/Utils/utils.js' as Utils
// =============================================================================
function initView () {
@ -75,3 +77,26 @@ function sendMessage (text) {
if(container.proxyModel)
container.proxyModel.sendMessage(text)
}
function forwardMessage(chatRoomModel, chatEntry, chatRoomConfig){
Qt.callLater(function (){// This avoid to detach virtual window while selecting chatroom/user. This can be the case when we got an address from the smartsearch bar that need to close itself before doing this stuff.
window.detachVirtualWindow()
window.attachVirtualWindow(Utils.buildCommonDialogUri('ConfirmDialog'), {
flat: true,
//: 'Do you want to forward this message?' : text to confirm to forward a message
descriptionText: '<b>'+qsTr('confirmForward'),
}, function (status) {
if (status) {
if(!chatRoomModel) {
var chat = CallsListModel.createChatRoom( chatRoomConfig.subject, chatRoomConfig.haveEncryption, chatRoomConfig.participants, chatRoomConfig.toSelect)
if(chat)
chatRoomModel = chat.chatRoomModel
}
if(chatRoomModel){
chatRoomModel.forwardMessage(chatEntry)
Linphone.TimelineListModel.select(chatRoomModel)
}
}
})
})
}

View file

@ -288,18 +288,12 @@ Rectangle {
//: 'Choose where to forward the message' : Dialog title for choosing where to forward the current message.
, {title: qsTr('forwardDialogTitle'),
addressSelectedCallback: function (sipAddress) {
var chat = CallsListModel.createChatRoom( '', proxyModel.chatRoomModel.haveEncryption, [sipAddress], false )
if(chat){
chat.chatRoomModel.forwardMessage(entry.chatEntry)
TimelineListModel.select(chat.chatRoomModel)
}
Logic.forwardMessage(undefined, entry.chatEntry, {subject:'', haveEncryption: proxyModel.chatRoomModel.haveEncryption, participants: [sipAddress], toSelect: false} )
},
chatRoomSelectedCallback: function (chatRoomModel){
if(chatRoomModel){
chatRoomModel.forwardMessage(entry.chatEntry)
TimelineListModel.select(chatRoomModel)
}
}
if(chatRoomModel)
Logic.forwardMessage(chatRoomModel, entry.chatEntry)
}
})
}

View file

@ -4,6 +4,7 @@ import QtQuick.Layouts 1.3
import Common 1.0
import Linphone 1.0
import Linphone.Styles 1.0
import UtilsCpp 1.0
// =============================================================================

View file

@ -55,19 +55,18 @@ DialogPlus {
secure: 0,
visible: true,
secureIconVisibleHandler : function(entry) {
return UtilsCpp.hasCapability(entry.sipAddress, LinphoneEnums.FriendCapabilityLimeX3Dh)
return UtilsCpp.hasCapability(entry.sipAddress, LinphoneEnums.FriendCapabilityLimeX3Dh, true)
},
handler: function (entry) {
console.debug("Call selected: " +entry + "/"+entry.sipAddress)
mainItem.addressSelectedCallback(entry.sipAddress)
exit(1)
smartSearchBar.entryClicked(entry)
},
}]
onEntryClicked: {
console.debug("Call selected: " +entry + "/"+entry.sipAddress)
console.debug("Call selected from button: " +entry + "/"+entry.sipAddress)
mainItem.addressSelectedCallback(entry.sipAddress)
exit(1)
mainItem.exit(1)
}
}
Text {
@ -90,7 +89,19 @@ DialogPlus {
Timeline {
id: timeline
showHistoryButton: false
optionsTogglable: false
anchors.fill: parent
actions:[
{
colorSet: SipAddressDialogStyle.select,
visible: true,
handler: function (entry) {
if( entry) {
entry.selected = true
}
}
}
]
model: TimelineProxyModel{
listSource: TimelineProxyModel.Copy
}

View file

@ -90,6 +90,12 @@ SearchBox {
colorSet: SettingsModel.getShowStartChatButton() ? SipAddressesViewStyle.chat : SipAddressesViewStyle.history,
secure: 1,
visible: SettingsModel.secureChatEnabled && AccountSettingsModel.conferenceUri != '',
secureIconVisibleHandler : function(entry) {
if(entry)
return UtilsCpp.hasCapability(entry.sipAddress ? entry.sipAddress : entry, LinphoneEnums.FriendCapabilityLimeX3Dh, true);
else
return false;
},
handler: function (entry) {
searchBox.launchSecureChat(entry.sipAddress)
searchBox.closeMenu()

View file

@ -25,7 +25,8 @@ Rectangle {
property bool showHistoryButton : CoreManager.callLogsCount
property bool isFilterVisible: searchView.visible || showFilterView
property bool showFiltersButtons: view.count > 0 || timeline.isFilterVisible || timeline.model.filterFlags > 0
property bool optionsTogglable: true
property var actions: []
// ---------------------------------------------------------------------------
signal entrySelected (TimelineModel entry)
@ -363,7 +364,8 @@ Rectangle {
delegate: TimelineItem{
timelineModel: $modelData
modelIndex: index
optionsTogglable: timeline.optionsTogglable
actions: timeline.actions
Connections{
target: $modelData
onSelectedChanged:{

View file

@ -17,8 +17,10 @@ import 'qrc:/ui/scripts/Utils/utils.js' as Utils
Rectangle {
id: mainItem
property TimelineModel timelineModel
property bool optionsTogglable: true // Right click => display/hide options
property bool optionsToggled: false
property int modelIndex: 0
property var actions: []
height: TimelineStyle.contact.height
width: parent ? parent.width : 0
@ -99,7 +101,7 @@ Rectangle {
onClicked: {
if(mouse.button == Qt.LeftButton){
mainItem.timelineModel.selected = true
}else{
}else if(mainItem.optionsTogglable){
mainItem.optionsToggled = !mainItem.optionsToggled
}
}
@ -151,6 +153,33 @@ Rectangle {
}
}
}
RowLayout{
anchors.fill: parent
anchors.rightMargin: 5
visible: mainItem.actions.length > 0
Item{// Spacer
Layout.fillHeight: true
Layout.fillWidth: true
}
Repeater {
model: mainItem.actions
ActionButton {
isCustom: true
backgroundRadius: 90
colorSet: modelData.colorSet
visible: modelData.visible
onClicked: {
mainItem.actions[index].handler( // Do not use modelData on functions
mainItem.timelineModel
)
}
}
}
}
Item{
id: optionsView
@ -165,9 +194,11 @@ Rectangle {
Layout.fillHeight: true
Layout.fillWidth: true
onClicked: {
mainItem.optionsToggled = !mainItem.optionsToggled
if(mainItem.optionsTogglable)
mainItem.optionsToggled = !mainItem.optionsToggled
}
}
Rectangle{
Layout.fillHeight: true
Layout.preferredWidth: optionsLayout.width

View file

@ -48,7 +48,7 @@ ColumnLayout {
secure: mainLayout.haveEncryption,
visible: true,
secureIconVisibleHandler : function(entry) {
return entry.sipAddress && mainLayout.haveEncryption && UtilsCpp.hasCapability(entry.sipAddress, LinphoneEnums.FriendCapabilityLimeX3Dh);
return entry.sipAddress && mainLayout.haveEncryption && UtilsCpp.hasCapability(entry.sipAddress, LinphoneEnums.FriendCapabilityLimeX3Dh, true);
},
handler: function (entry) {
selectedParticipants.addAddress(entry.sipAddress)

View file

@ -475,7 +475,7 @@ DialogPlus {
secure: SettingsModel.secureChatEnabled,
visible: true,
secureIconVisibleHandler : function(entry) {
return entry && entry.sipAddress ? UtilsCpp.hasCapability(entry.sipAddress, LinphoneEnums.FriendCapabilityLimeX3Dh) : false
return entry && entry.sipAddress ? UtilsCpp.hasCapability(entry.sipAddress, LinphoneEnums.FriendCapabilityLimeX3Dh, true) : false
},
handler: function (entry) {
if(entry){

View file

@ -88,7 +88,7 @@ DialogPlus {
secure: chatRoomModel.haveEncryption,
visible: true,
secureIconVisibleHandler : function(entry) {
return entry && entry.sipAddress && chatRoomModel && chatRoomModel.haveEncryption && UtilsCpp.hasCapability(entry.sipAddress, LinphoneEnums.FriendCapabilityLimeX3Dh);
return entry && entry.sipAddress && chatRoomModel && chatRoomModel.haveEncryption && UtilsCpp.hasCapability(entry.sipAddress, LinphoneEnums.FriendCapabilityLimeX3Dh, true);
},
handler: function (entry) {
selectedParticipants.addAddress(entry.sipAddress)

View file

@ -234,7 +234,7 @@ DialogPlus {
property int securityLevel : 2
anchors.top:parent.top
anchors.horizontalCenter: parent.right
visible: SettingsModel.secureChatEnabled && UtilsCpp.hasCapability(modelData.sipAddress, LinphoneEnums.FriendCapabilityLimeX3Dh)
visible: SettingsModel.secureChatEnabled && UtilsCpp.hasCapability(modelData.sipAddress, LinphoneEnums.FriendCapabilityLimeX3Dh, true)
icon: 'secure_on'
iconSize: parent.height/2
}
@ -330,7 +330,7 @@ DialogPlus {
secure: SettingsModel.secureChatEnabled,
visible: true,
secureIconVisibleHandler : function(entry) {
return entry && entry.sipsipAddress ? UtilsCpp.hasCapability(entry.sipAddress, LinphoneEnums.FriendCapabilityLimeX3Dh) : false
return entry && entry.sipsipAddress ? UtilsCpp.hasCapability(entry.sipAddress, LinphoneEnums.FriendCapabilityLimeX3Dh, true) : false
},
handler: function (entry) {
selectedParticipants.addAddress(entry.sipAddress)

@ -1 +1 @@
Subproject commit 064f9d56e1fc17e55bc696c59ebfeac69aa38418
Subproject commit ac2c5f4a9abbf295f3c6045d3d988a84cea752ed