summaryrefslogtreecommitdiffstats
path: root/pica-client/main.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/main.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/main.cpp')
-rw-r--r--pica-client/main.cpp14
1 files changed, 7 insertions, 7 deletions
diff --git a/pica-client/main.cpp b/pica-client/main.cpp
index b4a71e8..9dd93fe 100644
--- a/pica-client/main.cpp
+++ b/pica-client/main.cpp
@@ -17,7 +17,7 @@ QString config_dir;
QString config_dbname;
SkyNet *skynet;
MainWindow *mainwindow;
-unsigned int account_id;
+unsigned char account_id[PICA_ID_SIZE];
class AskPassword *askpassword;
class MsgUIRouter *msguirouter;
@@ -59,7 +59,7 @@ static bool create_database()
query.exec("create table accounts \
(\
- id int primary key, \
+ id blob primary key, \
name varchar(64), \
cert_file varchar(255) not null, \
pkey_file varchar(255) not null, \
@@ -71,10 +71,10 @@ static bool create_database()
query.exec("create table contacts \
(\
- id int,\
+ id blob,\
name varchar(64), \
cert_pem text(2048), \
- account_id int not null, \
+ account_id blob not null, \
primary key(id, account_id),\
foreign key(account_id) references accounts(id) on delete cascade\
);");
@@ -101,8 +101,8 @@ static bool create_database()
query.exec("create table history \
(\
id integer primary key autoincrement, \
- contact_id int not null, \
- account_id int not null, \
+ contact_id blob not null, \
+ account_id blob not null, \
timestamp int not null, \
is_me int not null, \
is_delivered int not null, \
@@ -124,7 +124,7 @@ static bool create_database()
if (query.lastError().isValid())
goto showerror;
- query.exec("insert into schema_version values (1, strftime('%s','now'));"); //current schema version. update when needed
+ query.exec("insert into schema_version values (2, strftime('%s','now'));"); //current schema version. update when needed
if (query.lastError().isValid())
showerror: