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:
parent
5506379a97
commit
794c23a81a
|
@ -50,15 +50,14 @@ void OfflineMsgEngine::dischargeReceipt(int receipt)
|
||||||
if (msgIt != undeliveredMsgs.end())
|
if (msgIt != undeliveredMsgs.end())
|
||||||
{
|
{
|
||||||
HistoryKeeper::getInstance()->markAsSent(mID);
|
HistoryKeeper::getInstance()->markAsSent(mID);
|
||||||
msgIt.value().msg->markAsSent();
|
msgIt.value().msg->markAsSent(QDateTime::currentDateTime());
|
||||||
msgIt.value().msg->featureUpdate();
|
|
||||||
undeliveredMsgs.erase(msgIt);
|
undeliveredMsgs.erase(msgIt);
|
||||||
}
|
}
|
||||||
receipts.erase(it);
|
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);
|
QMutexLocker ml(&mutex);
|
||||||
|
|
||||||
|
@ -89,7 +88,7 @@ void OfflineMsgEngine::deliverOfflineMsgs()
|
||||||
registerReceipt(iter.value().receipt, iter.key(), iter.value().msg, iter.value().timestamp);
|
registerReceipt(iter.value().receipt, iter.key(), iter.value().msg, iter.value().timestamp);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
QString messageText = iter.value().msg->getRawMessage();
|
QString messageText = iter.value().msg->toString();
|
||||||
int rec;
|
int rec;
|
||||||
if (iter.value().msg->isAction())
|
if (iter.value().msg->isAction())
|
||||||
rec = Core::getInstance()->sendAction(f->getFriendID(), messageText);
|
rec = Core::getInstance()->sendAction(f->getFriendID(), messageText);
|
||||||
|
|
|
@ -21,7 +21,8 @@
|
||||||
#include <QSet>
|
#include <QSet>
|
||||||
#include <QMutex>
|
#include <QMutex>
|
||||||
#include <QDateTime>
|
#include <QDateTime>
|
||||||
#include "src/widget/tool/chatactions/messageaction.h"
|
#include <QMap>
|
||||||
|
#include "src/chatlog/chatmessage.h"
|
||||||
|
|
||||||
struct Friend;
|
struct Friend;
|
||||||
class QTimer;
|
class QTimer;
|
||||||
|
@ -34,7 +35,7 @@ public:
|
||||||
virtual ~OfflineMsgEngine();
|
virtual ~OfflineMsgEngine();
|
||||||
|
|
||||||
void dischargeReceipt(int receipt);
|
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:
|
public slots:
|
||||||
void deliverOfflineMsgs();
|
void deliverOfflineMsgs();
|
||||||
|
@ -43,7 +44,7 @@ public slots:
|
||||||
|
|
||||||
private:
|
private:
|
||||||
struct MsgPtr {
|
struct MsgPtr {
|
||||||
MessageActionPtr msg;
|
ChatMessage::Ptr msg;
|
||||||
QDateTime timestamp;
|
QDateTime timestamp;
|
||||||
int receipt;
|
int receipt;
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in New Issue
Block a user