aboutsummaryrefslogtreecommitdiff
path: root/libdino/src/service
diff options
context:
space:
mode:
authorfiaxh <git@mx.ax.lt>2017-08-23 20:30:44 +0200
committerfiaxh <git@mx.ax.lt>2017-08-25 22:29:40 +0200
commit5fcf8e73efeea60413a383e6e6a096a3981be1a2 (patch)
tree8f7aa88a0b167d46a90c2966b3ea15959a8a4014 /libdino/src/service
parent7b395263c1ec0e6b057f7c3bb1d0525f6f38964d (diff)
downloaddino-5fcf8e73efeea60413a383e6e6a096a3981be1a2.tar.gz
dino-5fcf8e73efeea60413a383e6e6a096a3981be1a2.zip
Show nicks in MUCs, real jid in individual occupant menu
Diffstat (limited to 'libdino/src/service')
-rw-r--r--libdino/src/service/message_processor.vala7
-rw-r--r--libdino/src/service/muc_manager.vala9
2 files changed, 7 insertions, 9 deletions
diff --git a/libdino/src/service/message_processor.vala b/libdino/src/service/message_processor.vala
index cc99bcc3..2bf3d615 100644
--- a/libdino/src/service/message_processor.vala
+++ b/libdino/src/service/message_processor.vala
@@ -167,7 +167,12 @@ public class MessageProcessor : StreamInteractionModule, Object {
message.local_time = new DateTime.now_local();
message.direction = Entities.Message.DIRECTION_SENT;
message.counterpart = conversation.counterpart;
- message.ourpart = new Jid(conversation.account.bare_jid.to_string() + "/" + conversation.account.resourcepart);
+ if (conversation.type_ in new Conversation.Type[]{Conversation.Type.GROUPCHAT, Conversation.Type.GROUPCHAT_PM}) {
+ message.ourpart = stream_interactor.get_module(MucManager.IDENTITY).get_own_jid(conversation.counterpart, conversation.account);
+ message.real_jid = conversation.account.bare_jid;
+ } else {
+ message.ourpart = new Jid.with_resource(conversation.account.bare_jid.to_string(), conversation.account.resourcepart);
+ }
message.marked = Entities.Message.Marked.UNSENT;
message.encryption = conversation.encryption;
diff --git a/libdino/src/service/muc_manager.vala b/libdino/src/service/muc_manager.vala
index ea261300..51b3822e 100644
--- a/libdino/src/service/muc_manager.vala
+++ b/libdino/src/service/muc_manager.vala
@@ -191,13 +191,6 @@ public class MucManager : StreamInteractionModule, Object {
return ret;
}
- public Jid? get_message_real_jid(Entities.Message message) {
- if (message.real_jid != null) {
- return new Jid(message.real_jid);
- }
- return null;
- }
-
public Jid? get_own_jid(Jid muc_jid, Account account) {
Core.XmppStream? stream = stream_interactor.get_stream(account);
if (stream != null) {
@@ -250,7 +243,7 @@ public class MucManager : StreamInteractionModule, Object {
if (Xep.DelayedDelivery.MessageFlag.get_flag(message.stanza) == null) {
string? real_jid = stream.get_flag(Xep.Muc.Flag.IDENTITY).get_real_jid(message.counterpart.to_string());
if (real_jid != null && real_jid != message.counterpart.to_string()) {
- message.real_jid = real_jid;
+ message.real_jid = new Jid(real_jid).bare_jid;
}
}
string? muc_nick = stream.get_flag(Xep.Muc.Flag.IDENTITY).get_muc_nick(conversation.counterpart.bare_jid.to_string());