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

minor fixes in ChatAction's creation/processing

This commit is contained in:
apprb 2014-11-25 01:58:57 +09:00
parent ba4d877b89
commit 465da29a43
No known key found for this signature in database
GPG Key ID: B001911B5B22FB9B
2 changed files with 6 additions and 3 deletions

View File

@ -216,8 +216,9 @@ void ChatForm::onFileRecvRequest(ToxFile file)
previousId = friendId;
}
chatWidget->insertMessage(ChatActionPtr(new FileTransferAction(fileTrans, getElidedName(name),
QTime::currentTime().toString("hh:mm"), false)));
QString dateStr = QTime::currentTime().toString(Settings::getInstance().getTimestampFormat());
FileTransferAction *fa = new FileTransferAction(fileTrans, getElidedName(name), dateStr, false);
chatWidget->insertMessage(ChatActionPtr(fa));
if (!Settings::getInstance().getAutoAcceptDir(f->getToxID()).isEmpty()
|| Settings::getInstance().getAutoSaveEnabled())

View File

@ -229,7 +229,9 @@ void GenericChatForm::addAlertMessage(const ToxID &author, QString message, QDat
authorStr = author.publicKey;
QString date = datetime.toString(Settings::getInstance().getTimestampFormat());
chatWidget->insertMessage(ChatActionPtr(new AlertAction(authorStr, message, date)));
MessageActionPtr ca = MessageActionPtr(new AlertAction(authorStr, message, date));
ca->markAsSent();
chatWidget->insertMessage(ca);
previousId = author;
}