|
|
|
@ -703,7 +703,6 @@ void ChatForm::loadHistory(QDateTime since, bool processUndelivered)
@@ -703,7 +703,6 @@ void ChatForm::loadHistory(QDateTime since, bool processUndelivered)
|
|
|
|
|
std::swap(storedPrevId, previousId); |
|
|
|
|
QList<ChatMessage*> historyMessages; |
|
|
|
|
|
|
|
|
|
//TODO: possibly broken
|
|
|
|
|
QDate lastDate(1,0,0); |
|
|
|
|
for (const auto &it : msgs) |
|
|
|
|
{ |
|
|
|
@ -720,12 +719,11 @@ void ChatForm::loadHistory(QDateTime since, bool processUndelivered)
@@ -720,12 +719,11 @@ void ChatForm::loadHistory(QDateTime since, bool processUndelivered)
|
|
|
|
|
ToxID msgSender = ToxID::fromString(it.sender); |
|
|
|
|
|
|
|
|
|
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)); |
|
|
|
|
|
|
|
|
|
ChatMessage* msg = addMessage(msgSender, |
|
|
|
|
isAction ? it.message.right(it.message.length() - 4) : it.message, |
|
|
|
|
isAction, QDateTime::currentDateTime(), |
|
|
|
|
false); |
|
|
|
|
|
|
|
|
|
if (it.isSent || !msgSender.isMine()) |
|
|
|
|
{ |
|
|
|
|