diff options
| author | me_desk <me_desk@fb96df88-216d-11de-830c-f3023f12d8ac> | 2013-01-12 22:02:09 +0000 |
|---|---|---|
| committer | me_desk <me_desk@fb96df88-216d-11de-830c-f3023f12d8ac> | 2013-01-12 22:02:09 +0000 |
| commit | da68f9e85db0f232656542564bd770240e28110e (patch) | |
| tree | f61c18c2a6ef1b612c8469be10ea61c3141b227a /pica-client/main.cpp | |
| parent | 3eb742498edba38d42773818e949331b9664ee80 (diff) | |
| download | pica-pica-da68f9e85db0f232656542564bd770240e28110e.tar.gz pica-pica-da68f9e85db0f232656542564bd770240e28110e.zip | |
new class History for storing message history and undelivered messages between restarts
git-svn-id: svn://localhost/project_picapica/trunk@220 fb96df88-216d-11de-830c-f3023f12d8ac
Diffstat (limited to 'pica-client/main.cpp')
| -rw-r--r-- | pica-client/main.cpp | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/pica-client/main.cpp b/pica-client/main.cpp index 9a71a43..5d04501 100644 --- a/pica-client/main.cpp +++ b/pica-client/main.cpp @@ -115,6 +115,22 @@ static bool create_config_dir() query.exec("insert into nodes values(\"picapica.im\", 2299, 0, 0);"); query.exec("insert into nodes values(\"picapica.ge\", 2299, 0, 0);"); + if (query.lastError().isValid()) + goto showerror; + + query.exec("create table history \ + (\ + id integer primary key autoincrement, \ + contact_id int not null, \ + account_id int not null, \ + timestamp int not null, \ + is_me int not null, \ + is_delivered int not null, \ + message text(65536) not null, \ + foreign key(contact_id) references contacts(id) on delete cascade\ + foreign key(account_id) references accounts(id) on delete cascade\ + );" + ); if (query.lastError().isValid()) showerror: |
