mirror of
https://github.com/qTox/qTox.git
synced 2024-03-22 14:00:36 +08:00
honouring aliases in the loaded history
Conflicts: src/widget/form/chatform.cpp
This commit is contained in:
parent
2ee1363be5
commit
64e0116476
@ -717,9 +717,17 @@ void ChatForm::loadHistory(QDateTime since, bool processUndelivered)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Show each messages
|
// Show each messages
|
||||||
ToxID id = ToxID::fromString(it.sender);
|
ToxID msgSender = ToxID::fromString(it.sender);
|
||||||
ChatMessage* msg = chatWidget->addChatMessage(Core::getInstance()->getPeerName(id), it.message, id.isMine(), false);
|
|
||||||
if (it.isSent || !id.isMine())
|
bool isAction = it.message.startsWith("/me ");
|
||||||
|
ChatMessage* msg;
|
||||||
|
QString authorStr = (msgSender.isMine() ? Core::getInstance()->getUsername() : resolveToxID(msgSender));
|
||||||
|
if (!isAction)
|
||||||
|
msg = chatWidget->addChatMessage(authorStr, it.message, msgSender.isMine(), false);
|
||||||
|
else
|
||||||
|
msg = chatWidget->addChatAction(authorStr, it.message.right(it.message.length() - 4));
|
||||||
|
|
||||||
|
if (it.isSent || !msgSender.isMine())
|
||||||
{
|
{
|
||||||
msg->markAsSent(msgDateTime);
|
msg->markAsSent(msgDateTime);
|
||||||
}
|
}
|
||||||
@ -727,7 +735,11 @@ void ChatForm::loadHistory(QDateTime since, bool processUndelivered)
|
|||||||
{
|
{
|
||||||
if (processUndelivered)
|
if (processUndelivered)
|
||||||
{
|
{
|
||||||
int rec = Core::getInstance()->sendMessage(f->getFriendID(), msg->toString());
|
int rec;
|
||||||
|
if (!isAction)
|
||||||
|
rec = Core::getInstance()->sendMessage(f->getFriendID(), msg->toString());
|
||||||
|
else
|
||||||
|
rec = Core::getInstance()->sendAction(f->getFriendID(), msg->toString());
|
||||||
registerReceipt(rec, it.id, msg);
|
registerReceipt(rec, it.id, msg);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user