summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorme_desk <me_desk@fb96df88-216d-11de-830c-f3023f12d8ac>2013-01-20 16:08:48 +0000
committerme_desk <me_desk@fb96df88-216d-11de-830c-f3023f12d8ac>2013-01-20 16:08:48 +0000
commit928d8538b2bc1c42e377def8466f50f0ed91291e (patch)
treea3c9ca33f4d159505508f5d4842558559d5184fc
parentdcec9bcedc769372f1d2a84d24755a8dda43238f (diff)
downloadpica-pica-928d8538b2bc1c42e377def8466f50f0ed91291e.tar.gz
pica-pica-928d8538b2bc1c42e377def8466f50f0ed91291e.zip
delivering undelivered messages from history
git-svn-id: svn://localhost/project_picapica/trunk@222 fb96df88-216d-11de-830c-f3023f12d8ac
-rw-r--r--pica-client/msguirouter.cpp7
-rw-r--r--pica-client/skynet.cpp10
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++)