Open chat directly from notification
This commit is contained in:
parent
266a72036b
commit
d39b1c4a10
3 changed files with 21 additions and 1 deletions
|
@ -43,6 +43,19 @@ Page {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Connections {
|
||||||
|
target: dBusAdaptor
|
||||||
|
onPleaseOpenMessage: {
|
||||||
|
console.log("[OverviewPage] Opening chat from external call...")
|
||||||
|
if (chatListCreated) {
|
||||||
|
if (status !== PageStatus.Active) {
|
||||||
|
pageStack.pop(pageStack.find( function(page){ return(page._depth === 0)} ), PageStackAction.Immediate);
|
||||||
|
}
|
||||||
|
pageStack.push(Qt.resolvedUrl("../pages/ChatPage.qml"), { "chatInformation" : tdLibWrapper.getChat(chatId) });
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
Timer {
|
Timer {
|
||||||
id: chatListCreatedTimer
|
id: chatListCreatedTimer
|
||||||
interval: 500
|
interval: 500
|
||||||
|
@ -201,7 +214,7 @@ Page {
|
||||||
model: chatListModel
|
model: chatListModel
|
||||||
delegate: ListItem {
|
delegate: ListItem {
|
||||||
|
|
||||||
id: chatListItem
|
id: chatListViewItem
|
||||||
|
|
||||||
contentHeight: chatListRow.height + chatListSeparator.height + 2 * Theme.paddingMedium
|
contentHeight: chatListRow.height + chatListSeparator.height + 2 * Theme.paddingMedium
|
||||||
contentWidth: parent.width
|
contentWidth: parent.width
|
||||||
|
|
|
@ -271,6 +271,12 @@ QVariantMap TDLibWrapper::getSuperGroup(const QString &groupId)
|
||||||
return this->superGroups.value(groupId).toMap();
|
return this->superGroups.value(groupId).toMap();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
QVariantMap TDLibWrapper::getChat(const QString &chatId)
|
||||||
|
{
|
||||||
|
qDebug() << "[TDLibWrapper] Returning chat information for ID " << chatId;
|
||||||
|
return this->chats.value(chatId).toMap();
|
||||||
|
}
|
||||||
|
|
||||||
void TDLibWrapper::copyFileToDownloads(const QString &filePath)
|
void TDLibWrapper::copyFileToDownloads(const QString &filePath)
|
||||||
{
|
{
|
||||||
qDebug() << "[TDLibWrapper] Copy file to downloads " << filePath;
|
qDebug() << "[TDLibWrapper] Copy file to downloads " << filePath;
|
||||||
|
|
|
@ -69,6 +69,7 @@ public:
|
||||||
Q_INVOKABLE QVariantMap getUnreadChatInformation();
|
Q_INVOKABLE QVariantMap getUnreadChatInformation();
|
||||||
Q_INVOKABLE QVariantMap getBasicGroup(const QString &groupId);
|
Q_INVOKABLE QVariantMap getBasicGroup(const QString &groupId);
|
||||||
Q_INVOKABLE QVariantMap getSuperGroup(const QString &groupId);
|
Q_INVOKABLE QVariantMap getSuperGroup(const QString &groupId);
|
||||||
|
Q_INVOKABLE QVariantMap getChat(const QString &chatId);
|
||||||
Q_INVOKABLE void copyFileToDownloads(const QString &filePath);
|
Q_INVOKABLE void copyFileToDownloads(const QString &filePath);
|
||||||
Q_INVOKABLE void openFileOnDevice(const QString &filePath);
|
Q_INVOKABLE void openFileOnDevice(const QString &filePath);
|
||||||
Q_INVOKABLE void controlScreenSaver(const bool &enabled);
|
Q_INVOKABLE void controlScreenSaver(const bool &enabled);
|
||||||
|
|
Loading…
Reference in a new issue