Add /join command support
This commit is contained in:
parent
ac525970b0
commit
76ddfb792b
9 changed files with 61 additions and 12 deletions
|
|
@ -148,6 +148,11 @@ TextInputWidget::onSendButtonClicked()
|
|||
|
||||
if (!text.isEmpty())
|
||||
emit sendEmoteMessage(text);
|
||||
} else if (msgText.startsWith(JOIN_COMMAND)) {
|
||||
auto room = parseJoinCommand(msgText);
|
||||
|
||||
if (!room.isEmpty())
|
||||
emit sendJoinRoomRequest(room);
|
||||
} else {
|
||||
emit sendTextMessage(msgText);
|
||||
}
|
||||
|
|
@ -155,6 +160,17 @@ TextInputWidget::onSendButtonClicked()
|
|||
input_->clear();
|
||||
}
|
||||
|
||||
QString
|
||||
TextInputWidget::parseJoinCommand(const QString &cmd)
|
||||
{
|
||||
auto room = cmd.right(cmd.size() - JOIN_COMMAND.size()).trimmed();
|
||||
|
||||
if (!room.isEmpty())
|
||||
return room;
|
||||
|
||||
return QString("");
|
||||
}
|
||||
|
||||
QString
|
||||
TextInputWidget::parseEmoteCommand(const QString &cmd)
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue