mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-06-29 01:53:54 -07:00
don't pm people ignoring you
This commit is contained in:
parent
0afdbc7222
commit
1bee788210
9 changed files with 36 additions and 5 deletions
|
|
@ -45,10 +45,18 @@ void TabMessage::sendMessage()
|
|||
if (sayEdit->text().isEmpty() || !userOnline)
|
||||
return;
|
||||
|
||||
client->sendCommand(new Command_Message(userName, sayEdit->text()));
|
||||
Command_Message *cmd = new Command_Message(userName, sayEdit->text());
|
||||
connect(cmd, SIGNAL(finished(ProtocolResponse *)), this, SLOT(messageSent(ProtocolResponse *)));
|
||||
client->sendCommand(cmd);
|
||||
sayEdit->clear();
|
||||
}
|
||||
|
||||
void TabMessage::messageSent(ProtocolResponse *response)
|
||||
{
|
||||
if (response->getResponseCode() == RespInIgnoreList)
|
||||
chatView->appendMessage(QString(), tr("This user is ignoring you."));
|
||||
}
|
||||
|
||||
void TabMessage::actLeave()
|
||||
{
|
||||
deleteLater();
|
||||
|
|
|
|||
|
|
@ -7,6 +7,7 @@ class AbstractClient;
|
|||
class ChatView;
|
||||
class QLineEdit;
|
||||
class Event_Message;
|
||||
class ProtocolResponse;
|
||||
|
||||
class TabMessage : public Tab {
|
||||
Q_OBJECT
|
||||
|
|
@ -24,6 +25,7 @@ signals:
|
|||
private slots:
|
||||
void sendMessage();
|
||||
void actLeave();
|
||||
void messageSent(ProtocolResponse *response);
|
||||
public:
|
||||
TabMessage(TabSupervisor *_tabSupervisor, AbstractClient *_client, const QString &_ownName, const QString &_userName);
|
||||
~TabMessage();
|
||||
|
|
|
|||
|
|
@ -80,7 +80,7 @@ void GameSelector::checkResponse(ResponseCode response)
|
|||
case RespNameNotFound: QMessageBox::critical(this, tr("Error"), tr("The game does not exist any more.")); break;
|
||||
case RespUserLevelTooLow: QMessageBox::critical(this, tr("Error"), tr("This game is only open to registered users.")); break;
|
||||
case RespOnlyBuddies: QMessageBox::critical(this, tr("Error"), tr("This game is only open to its creator's buddies.")); break;
|
||||
case RespOnIgnoreList: QMessageBox::critical(this, tr("Error"), tr("You are being ignored by the creator of this game.")); break;
|
||||
case RespInIgnoreList: QMessageBox::critical(this, tr("Error"), tr("You are being ignored by the creator of this game.")); break;
|
||||
default: ;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue