aboutsummaryrefslogtreecommitdiff
path: root/libdino/src/entity/message.vala
diff options
context:
space:
mode:
authorMarvin W <git@larma.de>2020-01-09 14:28:08 +0100
committerMarvin W <git@larma.de>2020-01-09 14:28:08 +0100
commit3fc9bdab053e23ab8e97afadfee0a05afad8d890 (patch)
treed0637d1aaf6f54ba68e6ce26816518a63eb5f6fb /libdino/src/entity/message.vala
parent5e1f646cbcc0cc4ac08faf76afe5becba4dfd4c6 (diff)
downloaddino-3fc9bdab053e23ab8e97afadfee0a05afad8d890.tar.gz
dino-3fc9bdab053e23ab8e97afadfee0a05afad8d890.zip
Correctly display names in groupchat pms
Also show "Me" when no local alias is set instead of JID
Diffstat (limited to 'libdino/src/entity/message.vala')
-rw-r--r--libdino/src/entity/message.vala8
1 files changed, 6 insertions, 2 deletions
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);