mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-09-21 17:15:09 -07:00
[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:
parent
6c8fcf7d19
commit
f466a25893
3 changed files with 35 additions and 7 deletions
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue