diff --git a/Linphone/core/camera/PreviewManager.cpp b/Linphone/core/camera/PreviewManager.cpp index b7c844c39..8804635df 100644 --- a/Linphone/core/camera/PreviewManager.cpp +++ b/Linphone/core/camera/PreviewManager.cpp @@ -71,10 +71,12 @@ QQuickFramebufferObject::Renderer *PreviewManager::subscribe(const CameraGui *ca App::postModelBlock([&renderer, isFirst = (itCandidate == mCandidates.begin()), name = itCandidate->first->getQmlName()]() { renderer = - (QQuickFramebufferObject::Renderer *)CoreModel::getInstance()->getCore()->createNativePreviewWindowId(); + (QQuickFramebufferObject::Renderer *)CoreModel::getInstance()->getCore()->createNativePreviewWindowId( + nullptr); if (!renderer) { // TODO debug renderer = - (QQuickFramebufferObject::Renderer *)CoreModel::getInstance()->getCore()->createNativePreviewWindowId(); + (QQuickFramebufferObject::Renderer *)CoreModel::getInstance()->getCore()->createNativePreviewWindowId( + nullptr); } if (isFirst) { lDebug() << "[PreviewManager] " << name << " Set Native Preview Id with " << renderer; diff --git a/Linphone/core/chat/message/ChatMessageCore.cpp b/Linphone/core/chat/message/ChatMessageCore.cpp index 6c40bbb65..7e280b5b8 100644 --- a/Linphone/core/chat/message/ChatMessageCore.cpp +++ b/Linphone/core/chat/message/ChatMessageCore.cpp @@ -120,6 +120,13 @@ ChatMessageCore::ChatMessageCore(const std::shared_ptr &c !chatroom->hasCapability((int)linphone::ChatRoom::Capabilities::OneToOne); mIsRead = chatmessage->isRead(); mMessageState = LinphoneEnums::fromLinphone(chatmessage->getState()); + mIsEphemeral = chatmessage->isEphemeral(); + if (mIsEphemeral) { + auto now = QDateTime::currentDateTime(); + mEphemeralDuration = chatmessage->getEphemeralExpireTime() == 0 + ? chatmessage->getEphemeralLifetime() + : now.secsTo(QDateTime::fromSecsSinceEpoch(chatmessage->getEphemeralExpireTime())); + } mMessageId = Utils::coreStringToAppString(chatmessage->getMessageId()); for (auto content : chatmessage->getContents()) { auto contentCore = ChatMessageContentCore::create(content, mChatMessageModel); @@ -182,14 +189,17 @@ ChatMessageCore::~ChatMessageCore() { void ChatMessageCore::setSelf(QSharedPointer me) { mChatMessageModelConnection = SafeConnection::create(me, mChatMessageModel); mChatMessageModelConnection->makeConnectToCore(&ChatMessageCore::lDelete, [this] { - mChatMessageModelConnection->invokeToModel([this] { mChatMessageModel->deleteMessageFromChatRoom(); }); + mChatMessageModelConnection->invokeToModel([this] { mChatMessageModel->deleteMessageFromChatRoom(true); }); }); - mChatMessageModelConnection->makeConnectToModel(&ChatMessageModel::messageDeleted, [this]() { - //: Deleted - Utils::showInformationPopup(tr("info_toast_deleted_title"), - //: The message has been deleted - tr("info_toast_deleted_message"), true); - emit deleted(); + mChatMessageModelConnection->makeConnectToModel(&ChatMessageModel::messageDeleted, [this](bool deletedByUser) { + mChatMessageModelConnection->invokeToCore([this, deletedByUser] { + //: Deleted + if (deletedByUser) + Utils::showInformationPopup(tr("info_toast_deleted_title"), + //: The message has been deleted + tr("info_toast_deleted_message"), true); + emit deleted(); + }); }); mChatMessageModelConnection->makeConnectToCore(&ChatMessageCore::lMarkAsRead, [this] { mChatMessageModelConnection->invokeToModel([this] { mChatMessageModel->markAsRead(); }); @@ -308,10 +318,13 @@ void ChatMessageCore::setSelf(QSharedPointer me) { auto imdnStatusList = computeDeliveryStatus(message); mChatMessageModelConnection->invokeToCore([this, imdnStatusList] { setImdnStatusList(imdnStatusList); }); }); - mChatMessageModelConnection->makeConnectToModel(&ChatMessageModel::ephemeralMessageTimerStarted, - [this](const std::shared_ptr &message) {}); - mChatMessageModelConnection->makeConnectToModel(&ChatMessageModel::ephemeralMessageDeleted, - [this](const std::shared_ptr &message) {}); + mChatMessageModelConnection->makeConnectToModel( + &ChatMessageModel::ephemeralMessageTimeUpdated, + [this](const std::shared_ptr &message, int expireTime) { + auto now = QDateTime::currentDateTime(); + int duration = now.secsTo(QDateTime::fromSecsSinceEpoch(expireTime)); + mChatMessageModelConnection->invokeToCore([this, duration] { setEphemeralDuration(duration); }); + }); } QList ChatMessageCore::computeDeliveryStatus(const std::shared_ptr &message) { @@ -405,6 +418,21 @@ bool ChatMessageCore::isFromChatGroup() const { return mIsFromChatGroup; } +bool ChatMessageCore::isEphemeral() const { + return mIsEphemeral; +} + +int ChatMessageCore::getEphemeralDuration() const { + return mEphemeralDuration; +} + +void ChatMessageCore::setEphemeralDuration(int duration) { + if (mEphemeralDuration != duration) { + mEphemeralDuration = duration; + emit ephemeralDurationChanged(duration); + } +} + bool ChatMessageCore::hasFileContent() const { return mHasFileContent; } diff --git a/Linphone/core/chat/message/ChatMessageCore.hpp b/Linphone/core/chat/message/ChatMessageCore.hpp index b4efd1171..98c89cf15 100644 --- a/Linphone/core/chat/message/ChatMessageCore.hpp +++ b/Linphone/core/chat/message/ChatMessageCore.hpp @@ -89,6 +89,9 @@ class ChatMessageCore : public QObject, public AbstractObject { messageStateChanged) Q_PROPERTY(bool isRemoteMessage READ isRemoteMessage CONSTANT) Q_PROPERTY(bool isFromChatGroup READ isFromChatGroup CONSTANT) + Q_PROPERTY(bool isEphemeral READ isEphemeral CONSTANT) + Q_PROPERTY( + int ephemeralDuration READ getEphemeralDuration WRITE setEphemeralDuration NOTIFY ephemeralDurationChanged) Q_PROPERTY(bool isRead READ isRead WRITE setIsRead NOTIFY isReadChanged) Q_PROPERTY(QString ownReaction READ getOwnReaction WRITE setOwnReaction NOTIFY messageReactionChanged) Q_PROPERTY(QStringList imdnStatusListAsString READ getImdnStatusListLabels NOTIFY imdnStatusListChanged) @@ -130,6 +133,9 @@ public: bool isRemoteMessage() const; bool isFromChatGroup() const; + bool isEphemeral() const; + int getEphemeralDuration() const; + void setEphemeralDuration(int duration); bool hasFileContent() const; @@ -169,6 +175,7 @@ signals: void imdnStatusListChanged(); void messageReactionChanged(); void singletonReactionMapChanged(); + void ephemeralDurationChanged(int duration); void lDelete(); void deleted(); @@ -205,6 +212,8 @@ private: bool mHasFileContent = false; bool mIsCalendarInvite = false; bool mIsVoiceRecording = false; + bool mIsEphemeral = false; + int mEphemeralDuration = 0; bool mIsOutgoing = false; QString mTotalReactionsLabel; diff --git a/Linphone/core/chat/message/EventLogList.cpp b/Linphone/core/chat/message/EventLogList.cpp index 4c15f2c0d..87db0ad9b 100644 --- a/Linphone/core/chat/message/EventLogList.cpp +++ b/Linphone/core/chat/message/EventLogList.cpp @@ -58,6 +58,21 @@ QSharedPointer EventLogList::getChatCore() const { return mChatCore; } +void EventLogList::connectItem(const QSharedPointer item) { + auto message = item->getChatMessageCore(); + if (message) { + connect(message.get(), &ChatMessageCore::deleted, this, [this, item] { + emit mChatCore->lUpdateLastMessage(); + remove(item); + }); + connect(message.get(), &ChatMessageCore::ephemeralDurationChanged, this, [this, item](int duration) { + int i; + get(item.get(), &i); + emit dataChanged(index(i), index(i)); + }); + } +} + void EventLogList::setChatCore(QSharedPointer core) { if (mChatCore != core) { if (mChatCore) disconnect(mChatCore.get(), &ChatCore::eventListChanged, this, nullptr); @@ -104,12 +119,7 @@ void EventLogList::setSelf(QSharedPointer me) { if (!mChatCore) return; auto events = mChatCore->getEventLogList(); for (auto &event : events) { - auto message = event->getChatMessageCore(); - if (message) - connect(message.get(), &ChatMessageCore::deleted, this, [this, message, event] { - emit mChatCore->lUpdateLastMessage(); - remove(event); - }); + connectItem(event); } resetData(events); }); diff --git a/Linphone/core/chat/message/EventLogList.hpp b/Linphone/core/chat/message/EventLogList.hpp index 6e112b778..dd9d5d1ed 100644 --- a/Linphone/core/chat/message/EventLogList.hpp +++ b/Linphone/core/chat/message/EventLogList.hpp @@ -27,6 +27,7 @@ #include class EventLogGui; +class EventLogCore; class ChatCore; class ChatGui; // ============================================================================= @@ -43,6 +44,8 @@ public: void setChatCore(QSharedPointer core); void setChatGui(ChatGui *chat); + void connectItem(const QSharedPointer item); + int findFirstUnreadIndex(); void setSelf(QSharedPointer me); diff --git a/Linphone/data/languages/de.ts b/Linphone/data/languages/de.ts index b0a61cb8b..e5624b5d7 100644 --- a/Linphone/data/languages/de.ts +++ b/Linphone/data/languages/de.ts @@ -1728,13 +1728,13 @@ ChatCore - + info_toast_deleted_title Deleted - + info_toast_deleted_message_history Message history has been deleted @@ -1807,25 +1807,25 @@ ChatMessage - + chat_message_copy_selection "Copy selection" - + chat_message_copy "Copy" - + chat_message_copied_to_clipboard_title Copied - + chat_message_copied_to_clipboard_toast "to clipboard" @@ -1855,19 +1855,19 @@ - + chat_message_reception_info "Reception info" - + chat_message_reply Reply - + chat_message_delete "Delete" @@ -1957,19 +1957,19 @@ Error ChatMessageCore - + all_reactions_label "Reactions": all reactions for one message label - + info_toast_deleted_title Deleted - + info_toast_deleted_message The message has been deleted @@ -5109,7 +5109,7 @@ Pour les activer dans un projet commercial, merci de nous contacter. Utils - + nMinute @@ -5117,7 +5117,7 @@ Pour les activer dans un projet commercial, merci de nous contacter. - + nHour @@ -5125,8 +5125,8 @@ Pour les activer dans un projet commercial, merci de nous contacter. - - + + nDay @@ -5134,7 +5134,7 @@ Pour les activer dans un projet commercial, merci de nous contacter. - + nWeek @@ -5142,7 +5142,7 @@ Pour les activer dans un projet commercial, merci de nous contacter. - + nSeconds @@ -5158,8 +5158,8 @@ Pour les activer dans un projet commercial, merci de nous contacter. - - + + information_popup_error_title Error ---------- @@ -5220,80 +5220,95 @@ Failed to create 1-1 conversation with %1 ! Gestern - + + duration_tomorrow + Tomorrow + + + + + duration_number_of_days + %1 jour(s) + + + + + + + call_zrtp_token_verification_possible_characters "ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789" ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789 - - + + information_popup_chatroom_creation_error_message Failed to create 1-1 conversation with %1 ! - + contact_presence_status_available - + contact_presence_status_away - + contact_presence_status_busy Beschäftigt - + contact_presence_status_do_not_disturb Nicht stören - + contact_presence_status_offline Offline - + chatMessage_error Cannot reply to invalid message - + recorder_error Error with the recorder - - + + chat_error - - - - + + + + info_popup_error_title Error - - + + info_popup_send_voice_message_error_message Could not send voice message : %1 - - + + info_popup_send_voice_message_sending_error_message Failed to create message from record @@ -5461,1117 +5476,1117 @@ Failed to create 1-1 conversation with %1 ! country - + Afghanistan Afghanistan - + Albania Albanien - + Algeria Algerien - + AmericanSamoa Amerikanisch-Samoa - + Andorra Andorra - + Angola Angola - + Anguilla Anguilla - + AntiguaAndBarbuda Antigua und Barbuda - + Argentina Argentinien - + Armenia Armenien - + Aruba Aruba - + Australia Australien - + Austria Österreich - + Azerbaijan Aserbaidschan - + Bahamas Bahamas - + Bahrain Bahrain - + Bangladesh Bangladesch - + Barbados Barbados - + Belarus Belarus - + Belgium Belgien - + Belize Belize - + Benin Benin - + Bermuda Bermuda - + Bhutan Bhutan - + Bolivia Bolivien - + BosniaAndHerzegowina Bosnien und Herzegowina - + Botswana Botswana - + Brazil Brasilien - + Brunei Brunei - + Bulgaria Bulgarien - + BurkinaFaso Burkina Faso - + Burundi Burundi - + Cambodia Kambodscha - + Cameroon Kamerun - + Canada Kanada - + CapeVerde Kap Verde - + CaymanIslands Caymaninseln - + CentralAfricanRepublic Zentralafrikanische Republik - + Chad Tschad - + Chile Chile - + China China - + Colombia Kolumbien - + Comoros Komoren - + PeoplesRepublicOfCongo Volksrepublik Kongo - + CookIslands Cookinseln - + CostaRica Kosta Rica - + IvoryCoast Elfenbeinküste - + Croatia Kroatien - + Cuba Kuba - + Cyprus Zypern - + CzechRepublic Tschechische Republik - + Denmark Dänemark - + Djibouti Dschibuti - + Dominica Dominica - + DominicanRepublic Dominikanische Republik - + Ecuador Ecuador - + Egypt Ägypten - + ElSalvador El Salvador - + EquatorialGuinea Äquatorialguinea - + Eritrea Eritrea - + Estonia Estland - + Ethiopia Äthiopien - + FalklandIslands Falklandinseln - + FaroeIslands Färöer-Inseln - + Fiji Fidschi - + Finland Finnland - + France Frankreich - + FrenchGuiana Französisch-Guayana - + FrenchPolynesia Französisch-Polynesien - + Gabon Gabon - + Gambia Gambia - + Georgia Georgien - + Germany Deutschland - + Ghana Ghana - + Gibraltar Gibraltar - + Greece Griechenland - + Greenland Grönland - + Grenada Grenada - + Guadeloupe Guadeloupe - + Guam Guam - + Guatemala Guatemala - + Guinea Guinea - + GuineaBissau Guinea-Bissau - + Guyana Guyana - + Haiti Haiti - + Honduras Honduras - + DemocraticRepublicOfCongo Demokratische Republik Kongo - + HongKong Hongkong - + Hungary Ungarn - + Iceland Island - + India Indien - + Indonesia Indonesien - + Iran Iran - + Iraq Irak - + Ireland Irland - + Israel Israel - + Italy Italien - + Jamaica Jamaika - + Japan Japan - + Jordan Jordanien - + Kazakhstan Kasachstan - + Kenya Kenia - + Kiribati Kiribati - + DemocraticRepublicOfKorea Demokratische Volksrepublik Korea - + RepublicOfKorea Republik Korea - + Kuwait Kuwait - + Kyrgyzstan Kirgisistan - + Laos Laos - + Latvia Lettland - + Lebanon Libanon - + Lesotho Lesotho - + Liberia Liberien - + Libya Libyen - + Liechtenstein Liechtenstein - + Lithuania Litauen - + Luxembourg Luxemburg - + Macau Macau - + Macedonia Mazedonien - + Madagascar Madagaskar - + Malawi Malawi - + Malaysia Malaysien - + Maldives Malediven - + Mali Mali - + Malta Malta - + MarshallIslands Marshallinseln - + Martinique Martinique - + Mauritania Mauretanien - + Mauritius Mauritius - + Mayotte Mayotte - + Mexico Mexiko - + Micronesia Föderierte Staaten von Mikronesien - + Moldova Moldawien - + Monaco Monaco - + Mongolia Mongolei - + Montenegro Montenegro - + Montserrat Montserrat - + Morocco Marokko - + Mozambique Mosambik - + Myanmar Myanmar - + Namibia Namibia - + NauruCountry Nauru - + Nepal Nepal - + Netherlands Niederlande - + NewCaledonia Neukaledonien - + NewZealand Neuseeland - + Nicaragua Nicaragua - + Niger Niger - + Nigeria Nigeria - + Niue Niue - + NorfolkIsland Norfolkinsel - + NorthernMarianaIslands Nördliche Marianeninseln - + Norway Norwegen - + Oman Oman - + Pakistan Pakistan - + Palau Palau - + PalestinianTerritories Palästinensische Gebiete - + Panama Panama - + PapuaNewGuinea Papua-Neuguinea - + Paraguay Paraguay - + Peru Peru - + Philippines Philippinen - + Poland Polen - + Portugal Portugal - + PuertoRico Puerto Rico - + Qatar Katar - + Reunion Réunion - + Romania Rumänien - + RussianFederation Russische Föderation - + Rwanda Ruanda - + SaintHelena Sankt Helena - + SaintKittsAndNevis Sankt Kitts und Nevis - + SaintLucia Sankt Lucia - + SaintPierreAndMiquelon Sankt Pierre und Miquelon - + SaintVincentAndTheGrenadines Sankt Vincent und die Grenadinen - + Samoa Samoa - + SanMarino San Marino - + SaoTomeAndPrincipe São Tomé und Príncipe - + SaudiArabia Saudi-Arabien - + Senegal Senegal - + Serbia Serbien - + Seychelles Seychellen - + SierraLeone Sierra Leone - + Singapore Singapur - + Slovakia Slowakei - + Slovenia Slowenien - + SolomonIslands Salomonen - + Somalia Somalia - + SouthAfrica Südafrika - + Spain Spanien - + SriLanka Sri Lanka - + Sudan Sudan - + Suriname Suriname - + Swaziland Eswatini - + Sweden Schweden - + Switzerland Schweiz - + Syria Syrien - + Taiwan Taiwan - + Tajikistan Tadschikistan - + Tanzania Tansania - + Thailand Thailand - + Togo Togo - + Tokelau Tokelau - + Tonga Tonga - + TrinidadAndTobago Trinidad und Tobago - + Tunisia Tunesien - + Turkey Türkei - + Turkmenistan Turkmenistan - + TurksAndCaicosIslands Turks- und Caicosinseln - + Tuvalu Tuvalu - + Uganda Uganda - + Ukraine Ukraine - + UnitedArabEmirates Vereinigte Arabische Emirate - + UnitedKingdom Vereinigtes Königreich - + UnitedStates Vereinigte Staaten - + Uruguay Uruguay - + Uzbekistan Usbekistan - + Vanuatu Vanuatu - + Venezuela Venezuela - + Vietnam Vietnam - + WallisAndFutunaIslands Wallis und Futuna Inseln - + Yemen Jemen - + Zambia Sambia - + Zimbabwe Simbabwe diff --git a/Linphone/data/languages/en.ts b/Linphone/data/languages/en.ts index f7efb0b25..4e0544922 100644 --- a/Linphone/data/languages/en.ts +++ b/Linphone/data/languages/en.ts @@ -1690,13 +1690,13 @@ ChatCore - + info_toast_deleted_title Deleted Deleted - + info_toast_deleted_message_history Message history has been deleted Message history has been deleted @@ -1769,25 +1769,25 @@ ChatMessage - + chat_message_copy_selection "Copy selection" Copy selection - + chat_message_copy "Copy" Copy - + chat_message_copied_to_clipboard_title Copied Copied - + chat_message_copied_to_clipboard_toast "to clipboard" in clipboard @@ -1817,19 +1817,19 @@ You replied - + chat_message_reception_info "Reception info" Reception info - + chat_message_reply Reply Reply - + chat_message_delete "Delete" Delete @@ -1919,19 +1919,19 @@ Error ChatMessageCore - + all_reactions_label "Reactions": all reactions for one message label Reactions - + info_toast_deleted_title Deleted Deleted - + info_toast_deleted_message The message has been deleted The message has been deleted @@ -5003,7 +5003,7 @@ To enable them in a commercial project, please contact us. Utils - + nSeconds %1 second @@ -5011,7 +5011,7 @@ To enable them in a commercial project, please contact us. - + nMinute %1 minute @@ -5019,7 +5019,7 @@ To enable them in a commercial project, please contact us. - + nHour %1 hour @@ -5027,8 +5027,8 @@ To enable them in a commercial project, please contact us. - - + + nDay %1 day @@ -5036,7 +5036,7 @@ To enable them in a commercial project, please contact us. - + nWeek %1 week @@ -5044,27 +5044,27 @@ To enable them in a commercial project, please contact us. - + contact_presence_status_available Available - + contact_presence_status_busy Busy - + contact_presence_status_do_not_disturb Do not disturb - + contact_presence_status_offline Offline - + contact_presence_status_away Idle/Away @@ -5077,8 +5077,8 @@ To enable them in a commercial project, please contact us. - - + + information_popup_error_title Error ---------- @@ -5139,55 +5139,70 @@ Failed to create 1-1 conversation with %1 ! Yesterday - + + duration_tomorrow + Tomorrow + Tomorrow + + + + duration_number_of_days + %1 jour(s) + + %n day + %n days + + + + call_zrtp_token_verification_possible_characters "ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789" ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789 - - + + information_popup_chatroom_creation_error_message Failed to create 1-1 conversation with %1 ! Failed to create 1-1 conversation with %1 ! - + chatMessage_error Cannot reply to invalid message Cannot reply to invalid message - + recorder_error Error with the recorder Error with the recorder - - + + chat_error Error in the chat - - - - + + + + info_popup_error_title Error Error - - + + info_popup_send_voice_message_error_message Could not send voice message : %1 Could not send voice message : %1 - - + + info_popup_send_voice_message_sending_error_message Failed to create message from record Failed to create message from record @@ -5355,1117 +5370,1117 @@ Failed to create 1-1 conversation with %1 ! country - + Afghanistan Afghanistan - + Albania Albania - + Algeria Algeria - + AmericanSamoa American Samoa - + Andorra Andorra - + Angola Angola - + Anguilla Anguilla - + AntiguaAndBarbuda Antigua-et-Barbuda - + Argentina Argentina - + Armenia Armenia - + Aruba Aruba - + Australia Australia - + Austria Austria - + Azerbaijan Azerbaijan - + Bahamas Bahamas - + Bahrain Bahrain - + Bangladesh Bangladesh - + Barbados Barbados - + Belarus Belarus - + Belgium Belgium - + Belize Belize - + Benin Benin - + Bermuda Bermuda - + Bhutan Bhutan - + Bolivia Bolivia - + BosniaAndHerzegowina Bosnia And Herzegowina - + Botswana Botswana - + Brazil Brazil - + Brunei Brunei - + Bulgaria Bulgaria - + BurkinaFaso Burkina Faso - + Burundi Burundi - + Cambodia Cambodia - + Cameroon Cameroon - + Canada Canada - + CapeVerde Cape Verde - + CaymanIslands Cayman Islands - + CentralAfricanRepublic Central African Republic - + Chad Chad - + Chile Chile - + China China - + Colombia Colombia - + Comoros Comoros - + PeoplesRepublicOfCongo Peoples Republic Of Congo - + CookIslands Cook Islands - + CostaRica Costa Rica - + IvoryCoast Ivory Coast - + Croatia Croatia - + Cuba Cuba - + Cyprus Cyprus - + CzechRepublic Czech Republic - + Denmark Denmark - + Djibouti Djibouti - + Dominica Dominica - + DominicanRepublic Dominican Republic - + Ecuador Ecuador - + Egypt Egypt - + ElSalvador El Salvador - + EquatorialGuinea Equatorial Guinea - + Eritrea Eritrea - + Estonia Estonia - + Ethiopia Ethiopia - + FalklandIslands Falkland Islands - + FaroeIslands Faroe Islands - + Fiji Fiji - + Finland Finland - + France France - + FrenchGuiana French Guiana - + FrenchPolynesia French Polynesia - + Gabon Gabon - + Gambia Gambia - + Georgia Georgia - + Germany Germany - + Ghana Ghana - + Gibraltar Gibraltar - + Greece Greece - + Greenland Greenland - + Grenada Grenada - + Guadeloupe Guadeloupe - + Guam Guam - + Guatemala Guatemala - + Guinea Guinea - + GuineaBissau Guinea-Bissau - + Guyana Guyana - + Haiti Haiti - + Honduras Honduras - + DemocraticRepublicOfCongo Democratic Republic Of Congo - + HongKong Hong Kong - + Hungary Hungary - + Iceland Iceland - + India India - + Indonesia Indonesia - + Iran Iran - + Iraq Iraq - + Ireland Ireland - + Israel Israel - + Italy Italie - + Jamaica Jamaica - + Japan Japan - + Jordan Jordan - + Kazakhstan Kazakhstan - + Kenya Kenya - + Kiribati Kiribati - + DemocraticRepublicOfKorea Democratic Republic Of Korea - + RepublicOfKorea Republic Of Korea - + Kuwait Kuwait - + Kyrgyzstan Kyrgyzstan - + Laos Laos - + Latvia Latvia - + Lebanon Lebanon - + Lesotho Lesotho - + Liberia Liberia - + Libya Libya - + Liechtenstein Liechtenstein - + Lithuania Lithuania - + Luxembourg Luxembourg - + Macau Macau - + Macedonia Macedonia - + Madagascar Madagascar - + Malawi Malawi - + Malaysia Malaysia - + Maldives Maldives - + Mali Mali - + Malta Malta - + MarshallIslands Marshall Islands - + Martinique Martinique - + Mauritania Mauritania - + Mauritius Mauritius - + Mayotte Mayotte - + Mexico Mexico - + Micronesia Micronesia - + Moldova Moldova - + Monaco Monaco - + Mongolia Mongolia - + Montenegro Montenegro - + Montserrat Montserrat - + Morocco Morocco - + Mozambique Mozambique - + Myanmar Myanmar - + Namibia Namibia - + NauruCountry Nauru Country - + Nepal Nepal - + Netherlands Netherlands - + NewCaledonia New-Caledonia - + NewZealand New-Zealand - + Nicaragua Nicaragua - + Niger Niger - + Nigeria Nigeria - + Niue Niue - + NorfolkIsland Norfolk Island - + NorthernMarianaIslands Northern Mariana Islands - + Norway Norway - + Oman Oman - + Pakistan Pakistan - + Palau Palau - + PalestinianTerritories Palestinian Territories - + Panama Panama - + PapuaNewGuinea Papua-New-Guinea - + Paraguay Paraguay - + Peru Peru - + Philippines Philippines - + Poland Poland - + Portugal Portugal - + PuertoRico Puerto Rico - + Qatar Qatar - + Reunion Reunion - + Romania Romania - + RussianFederation Russian Federation - + Rwanda Rwanda - + SaintHelena Saint-Helena - + SaintKittsAndNevis Saint-Kitts-And-Nevis - + SaintLucia Saint-Lucia - + SaintPierreAndMiquelon Saint-Pierre-And-Miquelon - + SaintVincentAndTheGrenadines Saint-Vincent And The Grenadines - + Samoa Samoa - + SanMarino San-Marino - + SaoTomeAndPrincipe Sao Tome-And-Principe - + SaudiArabia Saudi Arabia - + Senegal Senegal - + Serbia Serbia - + Seychelles Seychelles - + SierraLeone Sierra Leone - + Singapore Singapore - + Slovakia Slovakia - + Slovenia Slovenia - + SolomonIslands Solomon Islands - + Somalia Somalia - + SouthAfrica South Africa - + Spain Spain - + SriLanka Sri Lanka - + Sudan Sudan - + Suriname Suriname - + Swaziland Swaziland - + Sweden Sweden - + Switzerland Switzerland - + Syria Syria - + Taiwan Taiwan - + Tajikistan Tajikistan - + Tanzania Tanzania - + Thailand Thailand - + Togo Togo - + Tokelau Tokelau - + Tonga Tonga - + TrinidadAndTobago Trinidad-And-Tobago - + Tunisia Tunisia - + Turkey Turkey - + Turkmenistan Turkmenistan - + TurksAndCaicosIslands Turks And Caicos Islands - + Tuvalu Tuvalu - + Uganda Uganda - + Ukraine Ukraine - + UnitedArabEmirates United Arab Emirates - + UnitedKingdom United-Kingdom - + UnitedStates United-States - + Uruguay Uruguay - + Uzbekistan Uzbekistan - + Vanuatu Vanuatu - + Venezuela Venezuela - + Vietnam Vietnam - + WallisAndFutunaIslands Wallis And Futuna Islands - + Yemen Yemen - + Zambia Zambia - + Zimbabwe Zimbabwe diff --git a/Linphone/data/languages/fr_FR.ts b/Linphone/data/languages/fr_FR.ts index 48792ec9e..7cbd6cc09 100644 --- a/Linphone/data/languages/fr_FR.ts +++ b/Linphone/data/languages/fr_FR.ts @@ -1690,13 +1690,13 @@ ChatCore - + info_toast_deleted_title Deleted Supprimé - + info_toast_deleted_message_history Message history has been deleted L'historique des messages a été supprimé @@ -1769,25 +1769,25 @@ ChatMessage - + chat_message_copy_selection "Copy selection" Copier la sélection - + chat_message_copy "Copy" Copier - + chat_message_copied_to_clipboard_title Copied Copié - + chat_message_copied_to_clipboard_toast "to clipboard" dans le presse-papiers @@ -1817,19 +1817,19 @@ Vous avez répondu - + chat_message_reception_info "Reception info" Info de réception - + chat_message_reply Reply Répondre - + chat_message_delete "Delete" Supprimer @@ -1919,19 +1919,19 @@ Error ChatMessageCore - + all_reactions_label "Reactions": all reactions for one message label Réactions - + info_toast_deleted_title Deleted Supprimé - + info_toast_deleted_message The message has been deleted Le message a été supprimé @@ -2930,19 +2930,19 @@ en bout. Seul votre correspondant peut les déchiffrer. conference_ephemeral_message_enabled_event - Les messages éphémères activés + Messages éphémères activés Expiration : %1 conference_ephemeral_message_lifetime_changed_event - Les messages éphémères mis à jour + Messages éphémères mis à jour Expiration : %1 conference_ephemeral_message_disabled_event - Les messages éphémères désactivés + Messages éphémères désactivés @@ -5003,7 +5003,7 @@ Pour les activer dans un projet commercial, merci de nous contacter. Utils - + nMinute %1 minute @@ -5011,7 +5011,7 @@ Pour les activer dans un projet commercial, merci de nous contacter. - + nHour %1 heure @@ -5019,8 +5019,8 @@ Pour les activer dans un projet commercial, merci de nous contacter. - - + + nDay %1 jour @@ -5028,7 +5028,7 @@ Pour les activer dans un projet commercial, merci de nous contacter. - + nWeek %1 semaine @@ -5036,7 +5036,7 @@ Pour les activer dans un projet commercial, merci de nous contacter. - + nSeconds %1 seconde @@ -5044,27 +5044,27 @@ Pour les activer dans un projet commercial, merci de nous contacter. - + contact_presence_status_available Disponible - + contact_presence_status_busy Occupé - + contact_presence_status_do_not_disturb Ne pas déranger - + contact_presence_status_offline Hors ligne - + contact_presence_status_away Inactif/Absent @@ -5077,8 +5077,8 @@ Pour les activer dans un projet commercial, merci de nous contacter. - - + + information_popup_error_title Error ---------- @@ -5139,55 +5139,70 @@ Failed to create 1-1 conversation with %1 ! Hier - + + duration_tomorrow + Tomorrow + Demain + + + + duration_number_of_days + %1 jour(s) + + %n jour + %n jours + + + + call_zrtp_token_verification_possible_characters "ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789" ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789 - - + + information_popup_chatroom_creation_error_message Failed to create 1-1 conversation with %1 ! Erreur lors de la création de la conversation avec %1 - + chatMessage_error Cannot reply to invalid message Impossible de répondre : message invalide - + recorder_error Error with the recorder Erreur avec l'enregistreur - - + + chat_error Erreur dans le chat - - - - + + + + info_popup_error_title Error Erreur - - + + info_popup_send_voice_message_error_message Could not send voice message : %1 Impossible d'envoyer le message vocal : %1 - - + + info_popup_send_voice_message_sending_error_message Failed to create message from record Impossible de créer le message vocal @@ -5355,1117 +5370,1117 @@ Failed to create 1-1 conversation with %1 ! country - + Afghanistan Afghanistan - + Albania Albanie - + Algeria Algérie - + AmericanSamoa Samoa américaines - + Andorra Andorre - + Angola Angola - + Anguilla Anguilla - + AntiguaAndBarbuda Antigua-et-Barbuda - + Argentina Argentine - + Armenia Arménie - + Aruba Aruba - + Australia Australie - + Austria Autriche - + Azerbaijan Azerbaïdjan - + Bahamas Bahamas - + Bahrain Bahreïn - + Bangladesh Bangladesh - + Barbados Barbade - + Belarus Biélorussie - + Belgium Belgique - + Belize Belize - + Benin Bénin - + Bermuda Bermudes - + Bhutan Bhoutan - + Bolivia Bolivie - + BosniaAndHerzegowina Bosnie-Herzégovine - + Botswana Botswana - + Brazil Brésil - + Brunei Brunéi - + Bulgaria Bulgarie - + BurkinaFaso Burkina Faso - + Burundi Burundi - + Cambodia Cambodge - + Cameroon Cameroun - + Canada Canada - + CapeVerde Cap-Vert - + CaymanIslands Îles Caïmans - + CentralAfricanRepublic République centrafricaine - + Chad Tchad - + Chile Chili - + China Chine - + Colombia Colombie - + Comoros Comores - + PeoplesRepublicOfCongo République populaire du Congo - + CookIslands Îles Cook - + CostaRica Costa Rica - + IvoryCoast Côte d'Ivoire - + Croatia Croatie - + Cuba Cuba - + Cyprus Chypre - + CzechRepublic République Tchèque - + Denmark Danemark - + Djibouti Djibouti - + Dominica Dominique - + DominicanRepublic République dominicaine - + Ecuador Équateur - + Egypt Égypte - + ElSalvador El Salvador - + EquatorialGuinea Guinée équatoriale - + Eritrea Érythrée - + Estonia Estonie - + Ethiopia Éthiopie - + FalklandIslands Îles Falkland - + FaroeIslands Îles Féroé - + Fiji Fidji - + Finland Finlande - + France France - + FrenchGuiana Guyane française - + FrenchPolynesia Polynésie française - + Gabon Gabon - + Gambia Gambie - + Georgia Géorgie - + Germany Allemagne - + Ghana Ghana - + Gibraltar Gibraltar - + Greece Grèce - + Greenland Groenland - + Grenada Grenade - + Guadeloupe Guadeloupe - + Guam Guam - + Guatemala Guatemala - + Guinea Guinée - + GuineaBissau Guinée-Bissau - + Guyana Guyana - + Haiti Haïti - + Honduras Honduras - + DemocraticRepublicOfCongo République démocratique du Congo - + HongKong Hong Kong - + Hungary Hongrie - + Iceland Islande - + India Inde - + Indonesia Indonésie - + Iran Iran - + Iraq Irak - + Ireland Irlande - + Israel Israël - + Italy Italie - + Jamaica Jamaïque - + Japan Japon - + Jordan Jordanie - + Kazakhstan Kazakhstan - + Kenya Kenya - + Kiribati Kiribati - + DemocraticRepublicOfKorea Corée du Nord - + RepublicOfKorea Corée du Sud - + Kuwait Koweït - + Kyrgyzstan Kirghizistan - + Laos Laos - + Latvia Lettonie - + Lebanon Liban - + Lesotho Lesotho - + Liberia Libéria - + Libya Libye - + Liechtenstein Liechtenstein - + Lithuania Lituanie - + Luxembourg Luxembourg - + Macau Macao - + Macedonia Macédoine - + Madagascar Madagascar - + Malawi Malawi - + Malaysia Malaisie - + Maldives Maldives - + Mali Mali - + Malta Malte - + MarshallIslands Îles Marshall - + Martinique Martinique - + Mauritania Mauritanie - + Mauritius Maurice - + Mayotte Mayotte - + Mexico Mexique - + Micronesia Micronésie - + Moldova Moldavie - + Monaco Monaco - + Mongolia Mongolie - + Montenegro Montenegro - + Montserrat Montserrat - + Morocco Maroc - + Mozambique Mozambique - + Myanmar Myanmar - + Namibia Namibie - + NauruCountry Nauru - + Nepal Népal - + Netherlands Pays-Bas - + NewCaledonia Nouvelle-Calédonie - + NewZealand Nouvelle-Zélande - + Nicaragua Nicaragua - + Niger Niger - + Nigeria Nigeria - + Niue Niué - + NorfolkIsland Île Norfolk - + NorthernMarianaIslands Îles Mariannes du Nord - + Norway Norvège - + Oman Oman - + Pakistan Pakistan - + Palau Palaos - + PalestinianTerritories Palestine - + Panama Panama - + PapuaNewGuinea Papouasie-Nouvelle-Guinée - + Paraguay Paraguay - + Peru Pérou - + Philippines Philippines - + Poland Pologne - + Portugal Portugal - + PuertoRico Porto Rico - + Qatar Qatar - + Reunion La Réunion - + Romania Roumanie - + RussianFederation Russie - + Rwanda Rwanda - + SaintHelena Sainte-Hélène - + SaintKittsAndNevis Saint-Christophe-et-Niévès - + SaintLucia Sainte-Lucie - + SaintPierreAndMiquelon Saint-Pierre-et-Miquelon - + SaintVincentAndTheGrenadines Saint-Vincent et les Grenadines - + Samoa Samoa - + SanMarino Saint-Marin - + SaoTomeAndPrincipe Sao Tomé-et-Principe - + SaudiArabia Arabie saoudite - + Senegal Sénégal - + Serbia Serbie - + Seychelles Seychelles - + SierraLeone Sierra Leone - + Singapore Singapour - + Slovakia Slovaquie - + Slovenia Slovénie - + SolomonIslands Îles Salomon - + Somalia Somalie - + SouthAfrica Afrique du Sud - + Spain Espagne - + SriLanka Sri Lanka - + Sudan Soudan - + Suriname Suriname - + Swaziland Eswatini - + Sweden Suède - + Switzerland Suisse - + Syria Syrie - + Taiwan Taïwan - + Tajikistan Tadjikistan - + Tanzania Tanzanie - + Thailand Thaïlande - + Togo Togo - + Tokelau Tokelau - + Tonga Tonga - + TrinidadAndTobago Trinité-et-Tobago - + Tunisia Tunisie - + Turkey Turquie - + Turkmenistan Turkménistan - + TurksAndCaicosIslands Îles Turks et Caïques - + Tuvalu Tuvalu - + Uganda Ouganda - + Ukraine Ukraine - + UnitedArabEmirates Émirats arabes unis - + UnitedKingdom Royaume-Uni - + UnitedStates États-Unis - + Uruguay Uruguay - + Uzbekistan Ouzbékistan - + Vanuatu Vanuatu - + Venezuela Venezuela - + Vietnam Vietnam - + WallisAndFutunaIslands Wallis et Futuna - + Yemen Yémen - + Zambia Zambie - + Zimbabwe Zimbabwe diff --git a/Linphone/model/chat/ChatModel.cpp b/Linphone/model/chat/ChatModel.cpp index a54582383..9042c9c7c 100644 --- a/Linphone/model/chat/ChatModel.cpp +++ b/Linphone/model/chat/ChatModel.cpp @@ -323,7 +323,7 @@ void ChatModel::onEphemeralMessageTimerStarted(const std::shared_ptr &chatRoom, const std::shared_ptr &eventLog) { - emit onEphemeralMessageDeleted(chatRoom, eventLog); + emit ephemeralMessageDeleted(chatRoom, eventLog); } void ChatModel::onConferenceAddressGeneration(const std::shared_ptr &chatRoom) { diff --git a/Linphone/model/chat/message/ChatMessageModel.cpp b/Linphone/model/chat/message/ChatMessageModel.cpp index 6d073c046..5e1622de5 100644 --- a/Linphone/model/chat/message/ChatMessageModel.cpp +++ b/Linphone/model/chat/message/ChatMessageModel.cpp @@ -34,6 +34,16 @@ ChatMessageModel::ChatMessageModel(const std::shared_ptr : ::Listener(chatMessage, parent) { // lDebug() << "[ChatMessageModel] new" << this << " / SDKModel=" << chatMessage.get(); mustBeInLinphoneThread(getClassName()); + mEphemeralTimer.setInterval(60); + mEphemeralTimer.setSingleShot(false); + if (mMonitor->getEphemeralExpireTime() != 0) mEphemeralTimer.start(); + connect(&mEphemeralTimer, &QTimer::timeout, this, + [this] { emit ephemeralMessageTimeUpdated(mMonitor, mMonitor->getEphemeralExpireTime()); }); + connect(this, &ChatMessageModel::ephemeralMessageTimerStarted, this, [this] { mEphemeralTimer.start(); }); + connect(this, &ChatMessageModel::ephemeralMessageDeleted, this, [this] { + mEphemeralTimer.stop(); + deleteMessageFromChatRoom(false); + }); } ChatMessageModel::~ChatMessageModel() { @@ -85,11 +95,11 @@ void ChatMessageModel::markAsRead() { emit CoreModel::getInstance()->messageReadInChatRoom(mMonitor->getChatRoom()); } -void ChatMessageModel::deleteMessageFromChatRoom() { +void ChatMessageModel::deleteMessageFromChatRoom(bool deletedByUser) { auto chatRoom = mMonitor->getChatRoom(); if (chatRoom) { chatRoom->deleteMessage(mMonitor); - emit messageDeleted(); + emit messageDeleted(deletedByUser); } } diff --git a/Linphone/model/chat/message/ChatMessageModel.hpp b/Linphone/model/chat/message/ChatMessageModel.hpp index 1d64df15a..5ad9b71b2 100644 --- a/Linphone/model/chat/message/ChatMessageModel.hpp +++ b/Linphone/model/chat/message/ChatMessageModel.hpp @@ -51,7 +51,7 @@ public: bool isRead() const; void markAsRead(); - void deleteMessageFromChatRoom(); + void deleteMessageFromChatRoom(bool deletedByUser); void sendReaction(const QString &reaction); @@ -64,7 +64,7 @@ public: QString getOwnReaction() const; signals: - void messageDeleted(); + void messageDeleted(bool deletedByUser); void messageRead(); void msgStateChanged(const std::shared_ptr &message, linphone::ChatMessage::State state); @@ -94,9 +94,11 @@ signals: const std::shared_ptr &state); void ephemeralMessageTimerStarted(const std::shared_ptr &message); void ephemeralMessageDeleted(const std::shared_ptr &message); + void ephemeralMessageTimeUpdated(const std::shared_ptr &message, int expireTime); private: linphone::ChatMessage::State mMessageState; + QTimer mEphemeralTimer; DECLARE_ABSTRACT_OBJECT diff --git a/Linphone/model/sound-player/SoundPlayerModel.hpp b/Linphone/model/sound-player/SoundPlayerModel.hpp index 8ded897b1..a43a99d5e 100644 --- a/Linphone/model/sound-player/SoundPlayerModel.hpp +++ b/Linphone/model/sound-player/SoundPlayerModel.hpp @@ -74,7 +74,7 @@ signals: private: DECLARE_ABSTRACT_OBJECT - void onEofReached(const std::shared_ptr &player); + void onEofReached(const std::shared_ptr &player) override; }; #endif // SOUND_PLAYER_H_ diff --git a/Linphone/tool/QExifImageHeader.cpp b/Linphone/tool/QExifImageHeader.cpp index 5d96ff0d4..7a6be8afa 100644 --- a/Linphone/tool/QExifImageHeader.cpp +++ b/Linphone/tool/QExifImageHeader.cpp @@ -1011,7 +1011,7 @@ template quint32 QExifImageHeader::calculateSize(const QMap &values) const { quint32 size = sizeof(quint16); - foreach (const QExifValue &value, values) + for (const QExifValue &value : values) size += sizeOf(value); return size; @@ -1387,7 +1387,7 @@ QExifImageHeader::readIfdValues(QDataStream &stream, int startPos, const QList headers_ = headers; - foreach (const ExifIfdHeader &header, headers_) + for (const ExifIfdHeader &header : headers_) values[T(header.tag)] = readIfdValue(stream, startPos, header); return values; @@ -1491,7 +1491,7 @@ QExifImageHeader::writeExifHeader(QDataStream &stream, quint16 tag, const QExifV switch (value.type()) { case QExifValue::Byte: if (value.count() <= 4) { - foreach (quint8 byte, value.toByteVector()) + for (quint8 byte : value.toByteVector()) stream << byte; for (int j = value.count(); j < 4; j++) stream << quint8(0); @@ -1526,7 +1526,7 @@ QExifImageHeader::writeExifHeader(QDataStream &stream, quint16 tag, const QExifV break; case QExifValue::Short: if (value.count() <= 2) { - foreach (quint16 shrt, value.toShortVector()) + for (quint16 shrt : value.toShortVector()) stream << shrt; for (int j = value.count(); j < 2; j++) stream << quint16(0); @@ -1588,7 +1588,7 @@ void QExifImageHeader::writeExifValue(QDataStream &stream, const QExifValue &val switch (value.type()) { case QExifValue::Byte: if (value.count() > 4) - foreach (quint8 byte, value.toByteVector()) + for (quint8 byte : value.toByteVector()) stream << byte; break; case QExifValue::Undefined: @@ -1603,27 +1603,27 @@ void QExifImageHeader::writeExifValue(QDataStream &stream, const QExifValue &val break; case QExifValue::Short: if (value.count() > 2) - foreach (quint16 shrt, value.toShortVector()) + for (quint16 shrt : value.toShortVector()) stream << shrt; break; case QExifValue::Long: if (value.count() > 1) - foreach (quint32 lng, value.toLongVector()) + for (quint32 lng : value.toLongVector()) stream << lng; break; case QExifValue::SignedLong: if (value.count() > 1) - foreach (qint32 lng, value.toSignedLongVector()) + for (qint32 lng : value.toSignedLongVector()) stream << lng; break; case QExifValue::Rational: if (value.count() > 0) - foreach (QExifURational rational, value.toRationalVector()) + for (QExifURational rational : value.toRationalVector()) stream << rational; break; case QExifValue::SignedRational: if (value.count() > 0) - foreach (QExifSRational rational, value.toSignedRationalVector()) + for (QExifSRational rational : value.toSignedRationalVector()) stream << rational; break; default: diff --git a/Linphone/tool/Utils.cpp b/Linphone/tool/Utils.cpp index 7aa2e3efc..29c3973e7 100644 --- a/Linphone/tool/Utils.cpp +++ b/Linphone/tool/Utils.cpp @@ -356,9 +356,21 @@ QString Utils::formatTime(const QDateTime &date) { } QString Utils::formatDuration(int durationMs) { - QTime duration(0, 0); - duration = duration.addMSecs(durationMs); - return duration.hour() > 0 ? duration.toString("hh:mm:ss") : duration.toString("mm:ss"); + auto now = QDateTime::currentDateTime(); + auto end = now.addMSecs(durationMs); + auto daysTo = now.daysTo(end); + if (daysTo > 0) { + //: Tomorrow + if (daysTo == 1) return tr("duration_tomorrow"); + else { + //: %1 jour(s) + return tr("duration_number_of_days", "", daysTo); + } + } else { + QTime duration(0, 0); + duration = duration.addMSecs(durationMs); + return duration.hour() > 0 ? duration.toString("hh:mm:ss") : duration.toString("mm:ss"); + } } QString Utils::formatDateElapsedTime(const QDateTime &date) { diff --git a/Linphone/view/Control/Display/Chat/ChatMessage.qml b/Linphone/view/Control/Display/Chat/ChatMessage.qml index cf7204157..423cfeb18 100644 --- a/Linphone/view/Control/Display/Chat/ChatMessage.qml +++ b/Linphone/view/Control/Display/Chat/ChatMessage.qml @@ -204,30 +204,60 @@ Control.Control { } } RowLayout { - Layout.fillWidth: false + Layout.preferredHeight: childrenRect.height Layout.alignment: mainItem.isRemoteMessage ? Qt.AlignLeft : Qt.AlignRight - Text { - text: UtilsCpp.formatDate(mainItem.chatMessage.core.timestamp, true, false, "dd/MM") - color: DefaultStyle.main2_500main - font { - pixelSize: Typography.p3.pixelSize - weight: Typography.p3.weight + layoutDirection: mainItem.isRemoteMessage ? Qt.RightToLeft : Qt.LeftToRight + spacing: Math.round(7 * DefaultStyle.dp) + RowLayout { + spacing: Math.round(3 * DefaultStyle.dp) + Layout.preferredHeight: childrenRect.height + Text { + id: ephemeralTime + visible: mainItem.chatMessage.core.isEphemeral + color: DefaultStyle.main2_500main + text: UtilsCpp.formatDuration(mainItem.chatMessage.core.ephemeralDuration * 1000) + font { + pixelSize: Typography.p3.pixelSize + weight: Typography.p3.weight + } + } + EffectImage { + visible: mainItem.chatMessage.core.isEphemeral + imageSource: AppIcons.clockCountDown + colorizationColor: DefaultStyle.main2_500main + Layout.preferredWidth: visible ? 14 * DefaultStyle.dp : 0 + Layout.preferredHeight: visible ? 14 * DefaultStyle.dp : 0 } } - EffectImage { - visible: !mainItem.isRemoteMessage - Layout.preferredWidth: visible ? 14 * DefaultStyle.dp : 0 - Layout.preferredHeight: 14 * DefaultStyle.dp - colorizationColor: DefaultStyle.main1_500_main - imageSource: mainItem.msgState === LinphoneEnums.ChatMessageState.StateDelivered - ? AppIcons.envelope - : mainItem.msgState === LinphoneEnums.ChatMessageState.StateDeliveredToUser - ? AppIcons.check - : mainItem.msgState === LinphoneEnums.ChatMessageState.StateNotDelivered - ? AppIcons.warningCircle - : mainItem.msgState === LinphoneEnums.ChatMessageState.StateDisplayed - ? AppIcons.checks - : "" + RowLayout { + spacing: mainItem.isRemoteMessage ? 0 : Math.round(5 * DefaultStyle.dp) + Layout.alignment: Qt.AlignVCenter + Layout.preferredHeight: childrenRect.height + Text { + Layout.alignment: Qt.AlignVCenter + text: UtilsCpp.formatDate(mainItem.chatMessage.core.timestamp, true, false, "dd/MM") + color: DefaultStyle.main2_500main + font { + pixelSize: Typography.p3.pixelSize + weight: Typography.p3.weight + } + } + EffectImage { + visible: !mainItem.isRemoteMessage + Layout.preferredWidth: visible ? 14 * DefaultStyle.dp : 0 + Layout.preferredHeight: visible ? 14 * DefaultStyle.dp : 0 + Layout.alignment: Qt.AlignVCenter + colorizationColor: DefaultStyle.main1_500_main + imageSource: mainItem.msgState === LinphoneEnums.ChatMessageState.StateDelivered + ? AppIcons.envelope + : mainItem.msgState === LinphoneEnums.ChatMessageState.StateDeliveredToUser + ? AppIcons.check + : mainItem.msgState === LinphoneEnums.ChatMessageState.StateNotDelivered + ? AppIcons.warningCircle + : mainItem.msgState === LinphoneEnums.ChatMessageState.StateDisplayed + ? AppIcons.checks + : "" + } } } }