summaryrefslogtreecommitdiffstats
path: root/pica-client/history.cpp
diff options
context:
space:
mode:
authorme_desk <me_desk@fb96df88-216d-11de-830c-f3023f12d8ac>2013-08-30 13:34:02 +0000
committerme_desk <me_desk@fb96df88-216d-11de-830c-f3023f12d8ac>2013-08-30 13:34:02 +0000
commit0ef7c1d7471ce20fe54729c27858db864aedee91 (patch)
tree3a71b713febdbea19fc7358af68d9f6cfa3c3158 /pica-client/history.cpp
parentbfd5528f28264772a245dc29f41d4bb5d29fb1eb (diff)
downloadpica-pica-0ef7c1d7471ce20fe54729c27858db864aedee91.tar.gz
pica-pica-0ef7c1d7471ce20fe54729c27858db864aedee91.zip
updated pica-client to make it handle new id format. quint32 type for id is replaced with QByteArray in most places. Implemented verification callbacks in client and node that allow self-signed certificates
git-svn-id: svn://localhost/project_picapica/trunk@266 fb96df88-216d-11de-830c-f3023f12d8ac
Diffstat (limited to 'pica-client/history.cpp')
-rw-r--r--pica-client/history.cpp16
1 files changed, 8 insertions, 8 deletions
diff --git a/pica-client/history.cpp b/pica-client/history.cpp
index 31a4e22..b3883dd 100644
--- a/pica-client/history.cpp
+++ b/pica-client/history.cpp
@@ -1,7 +1,7 @@
#include "history.h"
#include <QDebug>
-History::History(QString storage, quint32 my_id)
+History::History(QString storage, QByteArray my_id)
: me_(my_id)
{
dbconn=QSqlDatabase::addDatabase("QSQLITE");
@@ -20,7 +20,7 @@ History::History(QString storage, quint32 my_id)
//check result, if foreign keys support is on
}
-void History::Add(quint32 peer_id, QString message, bool is_me)
+void History::Add(QByteArray peer_id, QString message, bool is_me)
{
QSqlQuery query;
@@ -50,7 +50,7 @@ void History::Add(quint32 peer_id, QString message, bool is_me)
lasterr=query.lastError();
}
-void History::SetDelivered(quint32 peer_id)
+void History::SetDelivered(QByteArray peer_id)
{
QSqlQuery query;
@@ -66,7 +66,7 @@ void History::SetDelivered(quint32 peer_id)
lasterr=query.lastError();
}
-QList<History::HistoryRecord> History::GetMessages(quint32 peer_id, quint32 start_timestamp, quint32 end_timestamp)
+QList<History::HistoryRecord> History::GetMessages(QByteArray peer_id, quint32 start_timestamp, quint32 end_timestamp)
{
QList<HistoryRecord> L;
HistoryRecord r;
@@ -90,7 +90,7 @@ QList<History::HistoryRecord> History::GetMessages(quint32 peer_id, quint32 star
while(query.next())
{
- r.peer_id = query.value(0).toUInt();
+ r.peer_id = query.value(0).toByteArray();
r.is_me = query.value(1).toBool();
r.is_delivered = query.value(2).toBool();
r.timestamp = query.value(3).toUInt();
@@ -102,9 +102,9 @@ QList<History::HistoryRecord> History::GetMessages(quint32 peer_id, quint32 star
return L;
}
-QMap<quint32, QList<QString> > History::GetUndeliveredMessages()
+QMap<QByteArray, QList<QString> > History::GetUndeliveredMessages()
{
- QMap<quint32, QList<QString> > M;
+ QMap<QByteArray, QList<QString> > M;
QSqlQuery query;
query.setForwardOnly(true);
@@ -122,7 +122,7 @@ QMap<quint32, QList<QString> > History::GetUndeliveredMessages()
while(query.next())
{
- M[query.value(0).toUInt()] << query.value(1).toString();
+ M[query.value(0).toByteArray()] << query.value(1).toString();
}
return M;