diff --git a/src/offlinemsgengine.cpp b/src/offlinemsgengine.cpp index bfb6bb04f..cdbbbb9e5 100644 --- a/src/offlinemsgengine.cpp +++ b/src/offlinemsgengine.cpp @@ -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 ×tamp) +void OfflineMsgEngine::registerReceipt(int receipt, int messageID, ChatMessage::Ptr msg, const QDateTime ×tamp) { 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); diff --git a/src/offlinemsgengine.h b/src/offlinemsgengine.h index 46e7639da..f9175b851 100644 --- a/src/offlinemsgengine.h +++ b/src/offlinemsgengine.h @@ -21,7 +21,8 @@ #include #include #include -#include "src/widget/tool/chatactions/messageaction.h" +#include +#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 ×tamp = QDateTime::currentDateTime()); + void registerReceipt(int receipt, int messageID, ChatMessage::Ptr msg, const QDateTime ×tamp = QDateTime::currentDateTime()); public slots: void deliverOfflineMsgs(); @@ -43,7 +44,7 @@ public slots: private: struct MsgPtr { - MessageActionPtr msg; + ChatMessage::Ptr msg; QDateTime timestamp; int receipt; };