From da68f9e85db0f232656542564bd770240e28110e Mon Sep 17 00:00:00 2001 From: me_desk Date: Sat, 12 Jan 2013 22:02:09 +0000 Subject: 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 --- pica-client/main.cpp | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'pica-client/main.cpp') 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: -- cgit v1.2.1