aboutsummaryrefslogtreecommitdiff
path: root/client/src/entity
diff options
context:
space:
mode:
authorfiaxh <git@mx.ax.lt>2017-03-09 15:34:32 +0100
committerfiaxh <git@mx.ax.lt>2017-03-09 15:45:03 +0100
commit5fc0435cc1227bf445d06a3931343020faaecd10 (patch)
tree329041d3b2545fc445e9f175d3d5fff755fd110b /client/src/entity
parentb1e6e51c4f79f57f0a01b183ef185408fb22cc36 (diff)
downloaddino-5fc0435cc1227bf445d06a3931343020faaecd10.tar.gz
dino-5fc0435cc1227bf445d06a3931343020faaecd10.zip
Save unsent messages (acc offline etc) and send later; don't send pgp messages if pgp error
Diffstat (limited to 'client/src/entity')
-rw-r--r--client/src/entity/conversation.vala18
-rw-r--r--client/src/entity/message.vala4
2 files changed, 14 insertions, 8 deletions
diff --git a/client/src/entity/conversation.vala b/client/src/entity/conversation.vala
index d5c861d9..2da6dce3 100644
--- a/client/src/entity/conversation.vala
+++ b/client/src/entity/conversation.vala
@@ -3,19 +3,23 @@ public class Conversation : Object {
public signal void object_updated(Conversation conversation);
- public const int ENCRYPTION_UNENCRYPTED = 0;
- public const int ENCRYPTION_PGP = 1;
+ public enum Encryption {
+ UNENCRYPTED,
+ PGP
+ }
- public const int TYPE_CHAT = 0;
- public const int TYPE_GROUPCHAT = 1;
+ public enum Type {
+ CHAT,
+ GROUPCHAT
+ }
public int id { get; set; }
public Account account { get; private set; }
public Jid counterpart { get; private set; }
public bool active { get; set; }
public DateTime last_active { get; set; }
- public int encryption { get; set; }
- public int? type_ { get; set; }
+ public Encryption encryption { get; set; }
+ public Type? type_ { get; set; }
public Message read_up_to { get; set; }
public Conversation(Jid jid, Account account) {
@@ -23,7 +27,7 @@ public class Conversation : Object {
this.account = account;
this.active = false;
this.last_active = new DateTime.from_unix_utc(0);
- this.encryption = ENCRYPTION_UNENCRYPTED;
+ this.encryption = Encryption.UNENCRYPTED;
}
public Conversation.with_id(Jid jid, Account account, int id) {
diff --git a/client/src/entity/message.vala b/client/src/entity/message.vala
index 042166b0..65d05bdf 100644
--- a/client/src/entity/message.vala
+++ b/client/src/entity/message.vala
@@ -11,7 +11,9 @@ public class Dino.Entities.Message : Object {
NONE,
RECEIVED,
READ,
- ACKNOWLEDGED
+ ACKNOWLEDGED,
+ UNSENT,
+ WONTSEND
}
public enum Encryption {