Verified Commit bd649bb5 authored by Alexander Akulich's avatar Alexander Akulich
Browse files

MainLogModel: Add startChat(QString personUri) overload

parent 82026dcf
......@@ -251,6 +251,19 @@ bool MainLogModel::canChat(const QString &accountId) const
return false;
}
void MainLogModel::startChat(const QString &personUri)
{
const static QString scheme = QLatin1String("ktp://");
if (!personUri.startsWith(scheme)) {
return;
}
QString accountId = personUri.section(QLatin1Char('?'), 0, 0);
accountId = accountId.mid(scheme.length());
QString contactId = personUri.section(QLatin1Char('?'), 1, 1);
startChat(accountId, contactId);
}
void MainLogModel::startChat(const QString &accountId, const QString &contactId)
{
const QString objectPath = TP_QT_ACCOUNT_OBJECT_PATH_BASE + QLatin1Char('/') + accountId;
......
......@@ -118,6 +118,7 @@ Q_SIGNALS:
void newRequestedChannel(const QModelIndex &index);
public Q_SLOTS:
void startChat(const QString &personUri);
void startChat(const QString &accountId, const QString &contactId);
private Q_SLOTS:
......
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