1
0
mirror of https://github.com/qTox/qTox.git synced 2024-03-22 14:00:36 +08:00

Allow writing messages in a lonely groupchat

This commit is contained in:
Flakebi 2015-03-11 03:20:36 +01:00
parent fb63232318
commit 4920f2a2d4

View File

@ -101,13 +101,23 @@ void GroupChatForm::onSendTriggered()
msgEdit->setLastMessage(msg);
msgEdit->clear();
if (msg.startsWith("/me "))
bool isAction = msg.startsWith("/me ");
if (group->getPeersCount() != 1)
{
if (isAction)
{
msg = msg.right(msg.length() - 4);
emit sendAction(group->getGroupId(), msg);
} else {
}
else
emit sendMessage(group->getGroupId(), msg);
}
else
{
QDateTime timestamp = QDateTime::currentDateTime();
addSelfMessage(msg, isAction, timestamp, true);
}
}
void GroupChatForm::onUserListChanged()