From f24b47c44db03a8d9ba611f827e71aeb1f63d0bd Mon Sep 17 00:00:00 2001 From: fiaxh Date: Sun, 12 Mar 2017 14:44:09 +0100 Subject: PGP module: store data in own db, use pgp key as specified in account settings --- libdino/src/service/database.vala | 25 +------------------------ 1 file changed, 1 insertion(+), 24 deletions(-) (limited to 'libdino/src') diff --git a/libdino/src/service/database.vala b/libdino/src/service/database.vala index 83686424..b50581f8 100644 --- a/libdino/src/service/database.vala +++ b/libdino/src/service/database.vala @@ -103,16 +103,6 @@ public class Database : Qlite.Database { } } - public class PgpTable : Table { - public Column jid = new Column.Text("jid") { primary_key = true }; - public Column key = new Column.Text("key") { not_null = true }; - - protected PgpTable(Database db) { - base(db, "pgp"); - init({jid, key}); - } - } - public class EntityFeatureTable : Table { public Column entity = new Column.Text("entity"); public Column feature = new Column.Text("feature"); @@ -129,7 +119,6 @@ public class Database : Qlite.Database { public RealJidTable real_jid { get; private set; } public ConversationTable conversation { get; private set; } public AvatarTable avatar { get; private set; } - public PgpTable pgp { get; private set; } public EntityFeatureTable entity_feature { get; private set; } public Database(string fileName) { @@ -140,9 +129,8 @@ public class Database : Qlite.Database { real_jid = new RealJidTable(this); conversation = new ConversationTable(this); avatar = new AvatarTable(this); - pgp = new PgpTable(this); entity_feature = new EntityFeatureTable(this); - init({ account, jid, message, real_jid, conversation, avatar, pgp, entity_feature }); + init({ account, jid, message, real_jid, conversation, avatar, entity_feature }); } public override void migrate(long oldVersion) { @@ -420,17 +408,6 @@ public class Database : Qlite.Database { return ret; } - public void set_pgp_key(Jid jid, string key) { - pgp.insert().or("REPLACE") - .value(pgp.jid, jid.to_string()) - .value(pgp.key, key) - .perform(); - } - - public string? get_pgp_key(Jid jid) { - return pgp.select({pgp.key}).with(pgp.jid, "=", jid.to_string())[pgp.key]; - } - public void add_entity_features(string entity, ArrayList features) { foreach (string feature in features) { entity_feature.insert() -- cgit v1.2.3-54-g00ecf