mirror of
https://github.com/qTox/qTox.git
synced 2024-03-22 14:00:36 +08:00
change to Qt::CaseInseisitive
This commit is contained in:
parent
e3ce8b486a
commit
15f0360d4e
|
@ -815,7 +815,7 @@ void ChatForm::loadHistory(QDateTime since, bool processUndelivered)
|
||||||
// Show each messages
|
// Show each messages
|
||||||
ToxID authorId = ToxID::fromString(it.sender);
|
ToxID authorId = ToxID::fromString(it.sender);
|
||||||
QString authorStr = authorId.isMine() ? Core::getInstance()->getUsername() : resolveToxID(authorId);
|
QString authorStr = authorId.isMine() ? Core::getInstance()->getUsername() : resolveToxID(authorId);
|
||||||
bool isAction = it.message.startsWith("/me ") || it.message.startsWith("/ME ");
|
bool isAction = it.message.startsWith("/me ", Qt::CaseInsensitive);
|
||||||
|
|
||||||
ChatMessage::Ptr msg = ChatMessage::createChatMessage(authorStr,
|
ChatMessage::Ptr msg = ChatMessage::createChatMessage(authorStr,
|
||||||
isAction ? it.message.right(it.message.length() - 4) : it.message,
|
isAction ? it.message.right(it.message.length() - 4) : it.message,
|
||||||
|
@ -999,7 +999,7 @@ void ChatForm::SendMessageStr(QString msg)
|
||||||
if (msg.isEmpty())
|
if (msg.isEmpty())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
bool isAction = msg.startsWith("/me ") || msg.startsWith("/ME ");
|
bool isAction = msg.startsWith("/me ", Qt::CaseInsensitive);
|
||||||
if (isAction)
|
if (isAction)
|
||||||
msg = msg = msg.right(msg.length() - 4);
|
msg = msg = msg.right(msg.length() - 4);
|
||||||
|
|
||||||
|
|
|
@ -101,7 +101,7 @@ void GroupChatForm::onSendTriggered()
|
||||||
|
|
||||||
if (group->getPeersCount() != 1)
|
if (group->getPeersCount() != 1)
|
||||||
{
|
{
|
||||||
if (msg.startsWith("/me ") || msg.startsWith("/ME "))
|
if (msg.startsWith("/me ", Qt::CaseInsensitive))
|
||||||
{
|
{
|
||||||
msg = msg.right(msg.length() - 4);
|
msg = msg.right(msg.length() - 4);
|
||||||
emit sendAction(group->getGroupId(), msg);
|
emit sendAction(group->getGroupId(), msg);
|
||||||
|
@ -113,7 +113,7 @@ void GroupChatForm::onSendTriggered()
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (msg.startsWith("/me ") || msg.startsWith("/ME "))
|
if (msg.startsWith("/me ", Qt::CaseInsensitive))
|
||||||
addSelfMessage(msg.right(msg.length() - 4), true, QDateTime::currentDateTime(), true);
|
addSelfMessage(msg.right(msg.length() - 4), true, QDateTime::currentDateTime(), true);
|
||||||
else
|
else
|
||||||
addSelfMessage(msg, false, QDateTime::currentDateTime(), true);
|
addSelfMessage(msg, false, QDateTime::currentDateTime(), true);
|
||||||
|
|
Loading…
Reference in New Issue
Block a user