Commit d0619b87 authored by Ronan Abhamon's avatar Ronan Abhamon

feat(ui/views/App/Settings/SettingsCallsChat): supports file transfer

parent 5ac95dec
......@@ -56,11 +56,15 @@ void CoreHandlers::onMessageReceived (
const shared_ptr<linphone::ChatRoom> &,
const shared_ptr<linphone::ChatMessage> &message
) {
emit messageReceived(message);
const string content_type = message->getContentType();
const App *app = App::getInstance();
if (!app->hasFocus())
app->getNotifier()->notifyReceivedMessage(message);
if (content_type == "text/plain" || content_type == "application/vnd.gsma.rcs-ft-http+xml") {
emit messageReceived(message);
const App *app = App::getInstance();
if (!app->hasFocus())
app->getNotifier()->notifyReceivedMessage(message);
}
}
void CoreHandlers::onRegistrationStateChanged (
......
......@@ -42,6 +42,32 @@ SettingsModel::SettingsModel (QObject *parent) : QObject(parent) {
// Chat & calls.
// =============================================================================
bool SettingsModel::getAutoAnswerStatus () const {
return !!m_config->getInt(UI_SECTION, "auto_answer", 0);
}
void SettingsModel::setAutoAnswerStatus (bool status) {
m_config->setInt(UI_SECTION, "auto_answer", status);
emit autoAnswerStatusChanged(status);
}
// -----------------------------------------------------------------------------
QString SettingsModel::getFileTransferUrl () const {
return ::Utils::linphoneStringToQString(
CoreManager::getInstance()->getCore()->getFileTransferServer()
);
}
void SettingsModel::setFileTransferUrl (const QString &url) {
CoreManager::getInstance()->getCore()->setFileTransferServer(
::Utils::qStringToLinphoneString(url)
);
emit fileTransferUrlChanged(url);
}
// -----------------------------------------------------------------------------
bool SettingsModel::getLimeIsSupported () const {
return CoreManager::getInstance()->getCore()->limeAvailable();
}
......@@ -367,32 +393,6 @@ void SettingsModel::setDscpVideo (int dscp) {
// Misc.
// =============================================================================
bool SettingsModel::getAutoAnswerStatus () const {
return !!m_config->getInt(UI_SECTION, "auto_answer", 0);
}
void SettingsModel::setAutoAnswerStatus (bool status) {
m_config->setInt(UI_SECTION, "auto_answer", status);
emit autoAnswerStatusChanged(status);
}
// -----------------------------------------------------------------------------
QString SettingsModel::getFileTransferUrl () const {
return ::Utils::linphoneStringToQString(
CoreManager::getInstance()->getCore()->getFileTransferServer()
);
}
void SettingsModel::setFileTransferUrl (const QString &url) {
CoreManager::getInstance()->getCore()->setFileTransferServer(
::Utils::qStringToLinphoneString(url)
);
emit fileTransferUrlChanged(url);
}
// -----------------------------------------------------------------------------
QString SettingsModel::getSavedScreenshotsFolder () const {
return QDir::cleanPath(
::Utils::linphoneStringToQString(
......
......@@ -37,6 +37,9 @@ class SettingsModel : public QObject {
// Chat & calls. -------------------------------------------------------------
Q_PROPERTY(bool autoAnswerStatus READ getAutoAnswerStatus WRITE setAutoAnswerStatus NOTIFY autoAnswerStatusChanged);
Q_PROPERTY(QString fileTransferUrl READ getFileTransferUrl WRITE setFileTransferUrl NOTIFY fileTransferUrlChanged);
Q_PROPERTY(bool limeIsSupported READ getLimeIsSupported CONSTANT);
Q_PROPERTY(QVariantList supportedMediaEncryptions READ getSupportedMediaEncryptions CONSTANT);
......@@ -79,9 +82,6 @@ class SettingsModel : public QObject {
// Misc. ---------------------------------------------------------------------
Q_PROPERTY(bool autoAnswerStatus READ getAutoAnswerStatus WRITE setAutoAnswerStatus NOTIFY autoAnswerStatusChanged);
Q_PROPERTY(QString fileTransferUrl READ getFileTransferUrl WRITE setFileTransferUrl NOTIFY fileTransferUrlChanged);
Q_PROPERTY(QString savedScreenshotsFolder READ getSavedScreenshotsFolder WRITE setSavedScreenshotsFolder NOTIFY savedScreenshotsFolderChanged);
Q_PROPERTY(QString savedVideosFolder READ getSavedVideosFolder WRITE setSavedVideosFolder NOTIFY savedVideosFolderChanged);
......@@ -111,6 +111,12 @@ public:
// Chat & calls. -------------------------------------------------------------
bool getAutoAnswerStatus () const;
void setAutoAnswerStatus (bool status);
QString getFileTransferUrl () const;
void setFileTransferUrl (const QString &url);
bool getLimeIsSupported () const;
QVariantList getSupportedMediaEncryptions () const;
......@@ -175,12 +181,6 @@ public:
// Misc. ---------------------------------------------------------------------
bool getAutoAnswerStatus () const;
void setAutoAnswerStatus (bool status);
QString getFileTransferUrl () const;
void setFileTransferUrl (const QString &url);
QString getSavedScreenshotsFolder () const;
void setSavedScreenshotsFolder (const QString &folder);
......@@ -198,6 +198,9 @@ public:
signals:
// Chat & calls. -------------------------------------------------------------
void autoAnswerStatusChanged (bool status);
void fileTransferUrlChanged (const QString &url);
void mediaEncryptionChanged (MediaEncryption encryption);
void limeStateChanged (LimeState state);
......@@ -231,9 +234,6 @@ signals:
// Misc. ---------------------------------------------------------------------
void autoAnswerStatusChanged (bool status);
void fileTransferUrlChanged (const QString &url);
void savedScreenshotsFolderChanged (const QString &folder);
void savedVideosFolderChanged (const QString &folder);
......
......@@ -77,7 +77,11 @@ TabContainer {
FormGroup {
label: qsTr('fileServerLabel')
TextField {}
TextField {
text: SettingsModel.fileTransferUrl
onEditingFinished: SettingsModel.fileTransferUrl = text
}
}
}
......
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