aboutsummaryrefslogtreecommitdiff
path: root/libdino/src/entity
diff options
context:
space:
mode:
Diffstat (limited to 'libdino/src/entity')
-rw-r--r--libdino/src/entity/conversation.vala6
-rw-r--r--libdino/src/entity/message.vala8
2 files changed, 11 insertions, 3 deletions
diff --git a/libdino/src/entity/conversation.vala b/libdino/src/entity/conversation.vala
index d0ba4920..47ebd5d8 100644
--- a/libdino/src/entity/conversation.vala
+++ b/libdino/src/entity/conversation.vala
@@ -9,7 +9,11 @@ public class Conversation : Object {
public enum Type {
CHAT,
GROUPCHAT,
- GROUPCHAT_PM
+ GROUPCHAT_PM;
+
+ public bool is_muc_semantic() {
+ return this == GROUPCHAT || this == GROUPCHAT_PM;
+ }
}
public int id { get; set; }
diff --git a/libdino/src/entity/message.vala b/libdino/src/entity/message.vala
index d5697c72..e87d0e3a 100644
--- a/libdino/src/entity/message.vala
+++ b/libdino/src/entity/message.vala
@@ -22,7 +22,11 @@ public class Message : Object {
CHAT,
GROUPCHAT,
GROUPCHAT_PM,
- UNKNOWN
+ UNKNOWN;
+
+ public bool is_muc_semantic() {
+ return this == GROUPCHAT || this == GROUPCHAT_PM;
+ }
}
public int id { get; set; default = -1; }
@@ -74,7 +78,7 @@ public class Message : Object {
if (counterpart_resource != null) counterpart = counterpart.with_resource(counterpart_resource);
string our_resource = row[db.message.our_resource];
- if (type_ == Type.GROUPCHAT && our_resource != null) {
+ if (type_.is_muc_semantic() && our_resource != null) {
ourpart = counterpart.with_resource(our_resource);
} else if (our_resource != null) {
ourpart = account.bare_jid.with_resource(our_resource);