Add feedback when .wallop message is sent

This does the following:
- Opens a message-tab called "SUP" when a .wallop message is sent.
- Throws a validation error if another message is directly send into this "SUP" channel as another .wallop should be used.
This commit is contained in:
Lars Toenning
2020-07-26 11:57:59 +02:00
parent c4202d73f5
commit f987b81e6d
6 changed files with 33 additions and 0 deletions

View File

@@ -550,6 +550,9 @@ namespace BlackGui
const bool isBroadcast = textMessage.isBroadcastMessage();
if (isBroadcast) { cs.markAsBroadcastCallsign(); }
const bool isWallopMessage = textMessage.isWallopMessage();
if(isWallopMessage) { cs.markAsWallopCallsign(); }
const QWidget *tab = this->findTextMessageTabByCallsign(cs);
if (!tab) { tab = this->addNewTextMessageTab(cs); }
Q_ASSERT_X(tab, Q_FUNC_INFO, "Missing tab");
@@ -725,6 +728,10 @@ namespace BlackGui
{
CLogMessage(this).validationError(u"Incorrect message channel");
return {};
} else if (ui->tw_TextMessages->tabText(index) == "SUP")
{
CLogMessage(this).validationError(u"Message cannot be send to SUP channel. To send another wallop message use .wallop instead");
return{};
}
else
{