diff options
Diffstat (limited to 'libdino/src/service')
-rw-r--r-- | libdino/src/service/database.vala | 17 | ||||
-rw-r--r-- | libdino/src/service/message_processor.vala | 1 |
2 files changed, 15 insertions, 3 deletions
diff --git a/libdino/src/service/database.vala b/libdino/src/service/database.vala index 5a7eb46d..91a62cce 100644 --- a/libdino/src/service/database.vala +++ b/libdino/src/service/database.vala @@ -6,7 +6,7 @@ using Dino.Entities; namespace Dino { public class Database : Qlite.Database { - private const int VERSION = 4; + private const int VERSION = 5; public class AccountTable : Table { public Column<int> id = new Column.Integer("id") { primary_key = true, auto_increment = true }; @@ -133,6 +133,17 @@ public class Database : Qlite.Database { } } + public class SettingsTable : Table { + public Column<int> id = new Column.Integer("id") { primary_key = true, auto_increment = true }; + public Column<string> key = new Column.Text("key") { unique = true, not_null = true }; + public Column<string> value = new Column.Text("value"); + + internal SettingsTable(Database db) { + base(db, "settings"); + init({id, key, value}); + } + } + public AccountTable account { get; private set; } public JidTable jid { get; private set; } public MessageTable message { get; private set; } @@ -141,6 +152,7 @@ public class Database : Qlite.Database { public AvatarTable avatar { get; private set; } public EntityFeatureTable entity_feature { get; private set; } public RosterTable roster { get; private set; } + public SettingsTable settings { get; private set; } public Map<int, string> jid_table_cache = new HashMap<int, string>(); public Map<string, int> jid_table_reverse = new HashMap<string, int>(); @@ -156,7 +168,8 @@ public class Database : Qlite.Database { avatar = new AvatarTable(this); entity_feature = new EntityFeatureTable(this); roster = new RosterTable(this); - init({ account, jid, message, real_jid, conversation, avatar, entity_feature, roster }); + settings = new SettingsTable(this); + init({ account, jid, message, real_jid, conversation, avatar, entity_feature, roster, settings }); exec("PRAGMA synchronous=0"); } diff --git a/libdino/src/service/message_processor.vala b/libdino/src/service/message_processor.vala index d1490aa0..cc99bcc3 100644 --- a/libdino/src/service/message_processor.vala +++ b/libdino/src/service/message_processor.vala @@ -107,7 +107,6 @@ public class MessageProcessor : StreamInteractionModule, Object { bool is_mam_message = Xep.MessageArchiveManagement.MessageFlag.get_flag(stanza) != null; bool is_recent = new_message.local_time.compare(new DateTime.now_utc().add_hours(-24)) > 0; if (!is_mam_message || is_recent) { - print(new_message.local_time.to_string() + "\n"); if (new_message.direction == Entities.Message.DIRECTION_SENT) { message_sent(new_message, conversation); } else { |