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

Merge branch 'master' into chatlog_v3_1

This commit is contained in:
krepa098 2015-02-07 18:49:38 +01:00
parent 5506379a97
commit 794c23a81a
2 changed files with 7 additions and 7 deletions

View File

@ -50,15 +50,14 @@ void OfflineMsgEngine::dischargeReceipt(int receipt)
if (msgIt != undeliveredMsgs.end())
{
HistoryKeeper::getInstance()->markAsSent(mID);
msgIt.value().msg->markAsSent();
msgIt.value().msg->featureUpdate();
msgIt.value().msg->markAsSent(QDateTime::currentDateTime());
undeliveredMsgs.erase(msgIt);
}
receipts.erase(it);
}
}
void OfflineMsgEngine::registerReceipt(int receipt, int messageID, MessageActionPtr msg, const QDateTime &timestamp)
void OfflineMsgEngine::registerReceipt(int receipt, int messageID, ChatMessage::Ptr msg, const QDateTime &timestamp)
{
QMutexLocker ml(&mutex);
@ -89,7 +88,7 @@ void OfflineMsgEngine::deliverOfflineMsgs()
registerReceipt(iter.value().receipt, iter.key(), iter.value().msg, iter.value().timestamp);
continue;
}
QString messageText = iter.value().msg->getRawMessage();
QString messageText = iter.value().msg->toString();
int rec;
if (iter.value().msg->isAction())
rec = Core::getInstance()->sendAction(f->getFriendID(), messageText);

View File

@ -21,7 +21,8 @@
#include <QSet>
#include <QMutex>
#include <QDateTime>
#include "src/widget/tool/chatactions/messageaction.h"
#include <QMap>
#include "src/chatlog/chatmessage.h"
struct Friend;
class QTimer;
@ -34,7 +35,7 @@ public:
virtual ~OfflineMsgEngine();
void dischargeReceipt(int receipt);
void registerReceipt(int receipt, int messageID, MessageActionPtr msg, const QDateTime &timestamp = QDateTime::currentDateTime());
void registerReceipt(int receipt, int messageID, ChatMessage::Ptr msg, const QDateTime &timestamp = QDateTime::currentDateTime());
public slots:
void deliverOfflineMsgs();
@ -43,7 +44,7 @@ public slots:
private:
struct MsgPtr {
MessageActionPtr msg;
ChatMessage::Ptr msg;
QDateTime timestamp;
int receipt;
};