diff options
| -rw-r--r-- | pica-client/msguirouter.cpp | 7 | ||||
| -rw-r--r-- | pica-client/skynet.cpp | 10 |
2 files changed, 16 insertions, 1 deletions
diff --git a/pica-client/msguirouter.cpp b/pica-client/msguirouter.cpp index efa080c..d032bb1 100644 --- a/pica-client/msguirouter.cpp +++ b/pica-client/msguirouter.cpp @@ -1,5 +1,6 @@ #include "msguirouter.h" #include "dialogs/forgedcertdialog.h" +#include "history.h" /* @@ -84,6 +85,12 @@ void MsgUIRouter::delivered(quint32 to) { chatwindows[to]->msg_delivered(); } + else + { + History h(config_dbname, account_id); + + h.SetDelivered(to); + } } void MsgUIRouter::scary_cert_message(quint32 peer_id, QString received_cert, QString stored_cert) diff --git a/pica-client/skynet.cpp b/pica-client/skynet.cpp index 44f0101..942cdd0 100644 --- a/pica-client/skynet.cpp +++ b/pica-client/skynet.cpp @@ -7,7 +7,7 @@ //#include <QMessageBox> //debug //#include "dialogs/forgedcertdialog.h" #include <QDebug> - +#include "history.h" SkyNet::SkyNet() : nodes(config_dbname), QObject(0) @@ -62,6 +62,14 @@ void SkyNet::nodethread_connected(QString addr, quint16 port, NodeThread *thread //restore old peer connections, if any QList<quint32> c2c_peer_ids; + //load undelivered messages from history + if (msgqueues.isEmpty()) + { + History h(config_dbname, account_id); + + msgqueues = h.GetUndeliveredMessages(); + } + c2c_peer_ids = msgqueues.keys(); for (int i = 0; i < c2c_peer_ids.size(); i++) |
