aboutsummaryrefslogtreecommitdiff
path: root/libdino/src/entity
diff options
context:
space:
mode:
authorfiaxh <git@mx.ax.lt>2017-04-04 19:55:24 +0200
committerfiaxh <git@mx.ax.lt>2017-04-04 19:55:24 +0200
commitd6e742eb611f28fc2fcfbb67d4246f862df5c1c9 (patch)
tree11c49f20fc171843e8150b3ce545581172e31e87 /libdino/src/entity
parentcb3c896bdbd5f8308e250b9714bac3343f959678 (diff)
downloaddino-d6e742eb611f28fc2fcfbb67d4246f862df5c1c9.tar.gz
dino-d6e742eb611f28fc2fcfbb67d4246f862df5c1c9.zip
Application menu fallback button
Diffstat (limited to 'libdino/src/entity')
-rw-r--r--libdino/src/entity/message.vala5
1 files changed, 3 insertions, 2 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)