diff options
author | fiaxh <git@mx.ax.lt> | 2017-04-04 19:55:24 +0200 |
---|---|---|
committer | fiaxh <git@mx.ax.lt> | 2017-04-04 19:55:24 +0200 |
commit | d6e742eb611f28fc2fcfbb67d4246f862df5c1c9 (patch) | |
tree | 11c49f20fc171843e8150b3ce545581172e31e87 /libdino/src | |
parent | cb3c896bdbd5f8308e250b9714bac3343f959678 (diff) | |
download | dino-d6e742eb611f28fc2fcfbb67d4246f862df5c1c9.tar.gz dino-d6e742eb611f28fc2fcfbb67d4246f862df5c1c9.zip |
Application menu fallback button
Diffstat (limited to 'libdino/src')
-rw-r--r-- | libdino/src/entity/message.vala | 5 | ||||
-rw-r--r-- | libdino/src/service/message_processor.vala | 1 |
2 files changed, 3 insertions, 3 deletions
diff --git a/libdino/src/entity/message.vala b/libdino/src/entity/message.vala index 4624aa87..3092627e 100644 --- a/libdino/src/entity/message.vala +++ b/libdino/src/entity/message.vala @@ -24,7 +24,7 @@ public class Message : Object { UNKNOWN } - public int? id { get; set; } + public int id { get; set; default = -1; } public Account account { get; set; } public Jid? counterpart { get; set; } public Jid? ourpart { get; set; } @@ -49,7 +49,6 @@ public class Message : Object { private Database? db; public Message(string? body) { - this.id = -1; this.body = body; } @@ -75,6 +74,8 @@ public class Message : Object { } public void persist(Database db) { + if (id != -1) return; + this.db = db; Qlite.InsertBuilder builder = db.message.insert() .value(db.message.account_id, account.id) diff --git a/libdino/src/service/message_processor.vala b/libdino/src/service/message_processor.vala index 10954672..e8fa3c03 100644 --- a/libdino/src/service/message_processor.vala +++ b/libdino/src/service/message_processor.vala @@ -36,7 +36,6 @@ public class MessageProcessor : StreamInteractionModule, Object { public void send_message(string text, Conversation conversation) { Entities.Message message = create_out_message(text, conversation); stream_interactor.get_module(MessageStorage.IDENTITY).add_message(message, conversation); - message.persist(db); send_xmpp_message(message, conversation); message_sent(message, conversation); } |