[Client] Keep the message draft and notify when the recipient is offline (#7142)

* [Client] Keep the message draft and notify when the recipient is offline

* Don't blindly assume a user is online.

---------

Co-authored-by: Lukas Brübach <Bruebach.Lukas@bdosecurity.de>
This commit is contained in:
BruebachL 2026-08-17 00:16:55 +02:00 committed by GitHub
parent 6c8fcf7d19
commit f466a25893
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 35 additions and 7 deletions

View file

@ -904,8 +904,10 @@ TabMessage *TabSupervisor::addMessageTab(const QString &receiverName, bool focus
}
ServerInfo_User otherUser;
bool userOnline = false;
if (auto user = userListManager->getOnlineUser(receiverName)) {
otherUser = ServerInfo_User(*user);
userOnline = true;
} else {
otherUser.set_name(receiverName.toStdString());
}
@ -919,7 +921,7 @@ TabMessage *TabSupervisor::addMessageTab(const QString &receiverName, bool focus
return tab;
}
tab = new TabMessage(this, client, *userInfo, otherUser);
tab = new TabMessage(this, client, *userInfo, otherUser, userOnline);
connect(tab, &TabMessage::talkClosing, this, &TabSupervisor::talkLeft);
connect(tab, &TabMessage::maximizeClient, this, &TabSupervisor::maximizeMainWindow);
myAddTab(tab);