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:
parent
fb63232318
commit
4920f2a2d4
|
@ -101,12 +101,22 @@ void GroupChatForm::onSendTriggered()
|
|||
msgEdit->setLastMessage(msg);
|
||||
msgEdit->clear();
|
||||
|
||||
if (msg.startsWith("/me "))
|
||||
bool isAction = msg.startsWith("/me ");
|
||||
|
||||
if (group->getPeersCount() != 1)
|
||||
{
|
||||
msg = msg.right(msg.length() - 4);
|
||||
emit sendAction(group->getGroupId(), msg);
|
||||
} else {
|
||||
emit sendMessage(group->getGroupId(), msg);
|
||||
if (isAction)
|
||||
{
|
||||
msg = msg.right(msg.length() - 4);
|
||||
emit sendAction(group->getGroupId(), msg);
|
||||
}
|
||||
else
|
||||
emit sendMessage(group->getGroupId(), msg);
|
||||
}
|
||||
else
|
||||
{
|
||||
QDateTime timestamp = QDateTime::currentDateTime();
|
||||
addSelfMessage(msg, isAction, timestamp, true);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user