Commit 5c564b1f authored by Wescoeur's avatar Wescoeur

feat(ui/views/App/Main/InviteFriends): set default subject/message

parent 13bea18e
......@@ -814,11 +814,11 @@ Server url not configured.</translation>
<name>InviteFriends</name>
<message>
<source>enterEmailLabel</source>
<translation>Enter your friend&apos;s email address</translation>
<translation>Friend&apos;s email address</translation>
</message>
<message>
<source>messageLabel</source>
<translation>You can modify the invitation that will be sent</translation>
<translation>Message</translation>
</message>
<message>
<source>cancel</source>
......@@ -834,11 +834,18 @@ Server url not configured.</translation>
</message>
<message>
<source>defaultMessage</source>
<translation type="unfinished"></translation>
<translation>%1 wants to invite you on Linphone !</translation>
</message>
<message>
<source>defaultSubject</source>
<translation type="unfinished"></translation>
<translation>Linphone invitation</translation>
</message>
<message>
<source>forcedMessage</source>
<translation>Download the application on your computer and start calling and chatting with Linphone users for free.
Click here: &lt;a href=&quot;%1&quot;&gt;%1&lt;/a&gt;
</translation>
</message>
</context>
<context>
......
......@@ -834,11 +834,18 @@ Url du serveur non configurée.</translation>
</message>
<message>
<source>defaultMessage</source>
<translation type="unfinished"></translation>
<translation>%1 souhaite vous inviter sur Linphone !</translation>
</message>
<message>
<source>defaultSubject</source>
<translation type="unfinished"></translation>
<translation>Invitation Linphone</translation>
</message>
<message>
<source>forcedMessage</source>
<translation>Téléchargez lapplication sur votre ordinateur et appelez vos amis ou envoyez-leur un message sur Linphone gratuitement.
Cliquez ici : &lt;a href=&quot;%1&quot;&gt;%1&lt;/a&gt;
</translation>
</message>
</context>
<context>
......
......@@ -35,6 +35,8 @@
#define CBS_CALL_INTERVAL 20
#define DOWNLOAD_URL "https://www.linphone.org/technical-corner/linphone/downloads"
using namespace std;
// =============================================================================
......@@ -164,3 +166,9 @@ void CoreManager::iterate () {
mCore->iterate();
mInstance->unlockVideoRender();
}
// -----------------------------------------------------------------------------
QString CoreManager::getDownloadUrl () {
return QStringLiteral(DOWNLOAD_URL);
}
......@@ -43,6 +43,7 @@ class CoreManager : public QObject {
Q_OBJECT;
Q_PROPERTY(QString version READ getVersion CONSTANT);
Q_PROPERTY(QString downloadUrl READ getDownloadUrl CONSTANT);
public:
~CoreManager () = default;
......@@ -134,6 +135,8 @@ private:
void iterate ();
static QString getDownloadUrl ();
std::shared_ptr<linphone::Core> mCore;
std::shared_ptr<CoreHandlers> mHandlers;
......
......@@ -2,6 +2,7 @@ import QtQuick 2.7
import QtQuick.Layouts 1.3
import Common 1.0
import Linphone 1.0
import App.Styles 1.0
......@@ -47,7 +48,7 @@ Rectangle {
id: message
height: InviteFriendsStyle.message.height
text: qsTr('defaultMessage')
text: qsTr('defaultMessage').replace('%1', AccountSettingsModel.username)
}
}
}
......@@ -80,7 +81,9 @@ Rectangle {
Qt.openUrlExternally(
'mailto:' + encodeURIComponent(email.text) +
'?subject=' + encodeURIComponent(qsTr('defaultSubject')) +
'&body=' + encodeURIComponent(message.text)
'&body=' + encodeURIComponent(
message.text + '\n\n' + qsTr('forcedMessage').replace(/%1/g, CoreManager.downloadUrl)
)
)
window.setView('Home')
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment