diff options
author | fiaxh <git@lightrise.org> | 2021-01-21 15:39:36 +0100 |
---|---|---|
committer | fiaxh <git@lightrise.org> | 2021-01-21 15:51:41 +0100 |
commit | f12fc371a3bd00ac8c3183099d9d54528ef46bf0 (patch) | |
tree | 84cf27c7ed59372338bb43b45aa35027ff69ad23 /libdino/src/service | |
parent | 0d3070643884b0a8d960058d1df4d6cd07f9ec84 (diff) | |
download | dino-f12fc371a3bd00ac8c3183099d9d54528ef46bf0.tar.gz dino-f12fc371a3bd00ac8c3183099d9d54528ef46bf0.zip |
Make spell checking a setting, store language per conversation
Diffstat (limited to 'libdino/src/service')
-rw-r--r-- | libdino/src/service/database.vala | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/libdino/src/service/database.vala b/libdino/src/service/database.vala index 652971a0..17499404 100644 --- a/libdino/src/service/database.vala +++ b/libdino/src/service/database.vala @@ -7,7 +7,7 @@ using Dino.Entities; namespace Dino { public class Database : Qlite.Database { - private const int VERSION = 18; + private const int VERSION = 19; public class AccountTable : Table { public Column<int> id = new Column.Integer("id") { primary_key = true, auto_increment = true }; @@ -254,6 +254,19 @@ public class Database : Qlite.Database { } } + public class ConversationSettingsTable : Table { + public Column<int> id = new Column.Integer("id") { primary_key = true, auto_increment = true }; + public Column<int> conversation_id = new Column.Integer("conversation_id") {not_null=true}; + public Column<string> key = new Column.Text("key") { not_null=true }; + public Column<string> value = new Column.Text("value"); + + internal ConversationSettingsTable(Database db) { + base(db, "conversation_settings"); + init({id, conversation_id, key, value}); + index("settings_conversationid_key", { conversation_id, key }, true); + } + } + public AccountTable account { get; private set; } public JidTable jid { get; private set; } public EntityTable entity { get; private set; } @@ -269,6 +282,7 @@ public class Database : Qlite.Database { public RosterTable roster { get; private set; } public MamCatchupTable mam_catchup { get; private set; } public SettingsTable settings { get; private set; } + public ConversationSettingsTable conversation_settings { get; private set; } public Map<int, Jid> jid_table_cache = new HashMap<int, Jid>(); public Map<Jid, int> jid_table_reverse = new HashMap<Jid, int>(Jid.hash_func, Jid.equals_func); @@ -291,7 +305,8 @@ public class Database : Qlite.Database { roster = new RosterTable(this); mam_catchup = new MamCatchupTable(this); settings = new SettingsTable(this); - init({ account, jid, entity, content_item, message, message_correction, real_jid, file_transfer, conversation, avatar, entity_identity, entity_feature, roster, mam_catchup, settings }); + conversation_settings = new ConversationSettingsTable(this); + init({ account, jid, entity, content_item, message, message_correction, real_jid, file_transfer, conversation, avatar, entity_identity, entity_feature, roster, mam_catchup, settings, conversation_settings }); try { exec("PRAGMA journal_mode = WAL"); |