mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-09-28 08:52:19 -07:00
[Client] Keep the message draft and notify when the recipient is offline
This commit is contained in:
parent
078e67c56f
commit
78ce45372b
1 changed files with 9 additions and 1 deletions
|
|
@ -96,7 +96,15 @@ void TabMessage::closeEvent(QCloseEvent *event)
|
||||||
|
|
||||||
void TabMessage::sendMessage()
|
void TabMessage::sendMessage()
|
||||||
{
|
{
|
||||||
if (sayEdit->text().isEmpty() || !userOnline) {
|
if (sayEdit->text().isEmpty()) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!userOnline) {
|
||||||
|
// Keep the draft: the user may be back momentarily, and the typed text
|
||||||
|
// should not be lost to a transient offline spell.
|
||||||
|
chatView->appendMessage(
|
||||||
|
tr("Message not sent — %1 is offline.").arg(QString::fromStdString(otherUserInfo->name())));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue