Merge with master branch (notification hotfix)

This commit is contained in:
Sebastian Wolf 2020-11-20 19:22:43 +01:00
commit fb2e0786c9
3 changed files with 11 additions and 2 deletions

View file

@ -46,8 +46,8 @@ Page {
onPleaseOpenMessage: {
console.log("[OverviewPage] Opening chat from external call...")
if (chatListCreated) {
pageStack.pop(overviewPage, PageStackAction.Immediate);
pageStack.push(Qt.resolvedUrl("../pages/ChatPage.qml"), { "chatInformation" : tdLibWrapper.getChat(chatId) }, PageStackAction.Immediate)
pageStack.pop(overviewPage, PageStackAction.Immediate)
pageStack.push(Qt.resolvedUrl("../pages/ChatPage.qml"), { "chatInformation" : chatListModel.getById(chatId) }, PageStackAction.Immediate)
}
}
onPleaseOpenUrl: {

View file

@ -386,6 +386,14 @@ QVariantMap ChatListModel::get(int row)
return res;
}
QVariantMap ChatListModel::getById(qlonglong chatId)
{
if (chatIndexMap.contains(chatId)) {
return chatList.value(chatIndexMap.value(chatId))->chatData;
}
return QVariantMap();
}
int ChatListModel::updateChatOrder(int chatIndex)
{
ChatData *chat = chatList.at(chatIndex);

View file

@ -38,6 +38,7 @@ public:
Q_INVOKABLE void redrawModel();
Q_INVOKABLE QVariantMap get(int row);
Q_INVOKABLE QVariantMap getById(qlonglong chatId);
bool showAllChats() const;
void setShowAllChats(bool showAll);