diff options
author | Marvin W <git@larma.de> | 2020-01-09 14:28:08 +0100 |
---|---|---|
committer | Marvin W <git@larma.de> | 2020-01-09 14:28:08 +0100 |
commit | 3fc9bdab053e23ab8e97afadfee0a05afad8d890 (patch) | |
tree | d0637d1aaf6f54ba68e6ce26816518a63eb5f6fb /libdino/src/service | |
parent | 5e1f646cbcc0cc4ac08faf76afe5becba4dfd4c6 (diff) | |
download | dino-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/service')
-rw-r--r-- | libdino/src/service/content_item_store.vala | 2 | ||||
-rw-r--r-- | libdino/src/service/file_manager.vala | 4 | ||||
-rw-r--r-- | libdino/src/service/message_processor.vala | 2 |
3 files changed, 4 insertions, 4 deletions
diff --git a/libdino/src/service/content_item_store.vala b/libdino/src/service/content_item_store.vala index 673053c5..8be4d85f 100644 --- a/libdino/src/service/content_item_store.vala +++ b/libdino/src/service/content_item_store.vala @@ -68,7 +68,7 @@ public class ContentItemStore : StreamInteractionModule, Object { try { string storage_dir = FileManager.get_storage_dir(); FileTransfer file_transfer = new FileTransfer.from_row(db, row_option.inner, storage_dir); - if (conversation.type_ in new Conversation.Type[]{Conversation.Type.GROUPCHAT, Conversation.Type.GROUPCHAT_PM}) { + if (conversation.type_.is_muc_semantic()) { try { // resourcepart wasn't set before, so we pick nickname instead (which isn't accurate if nickname is changed) file_transfer.ourpart = conversation.counterpart.with_resource(file_transfer.ourpart.resourcepart ?? conversation.nickname); diff --git a/libdino/src/service/file_manager.vala b/libdino/src/service/file_manager.vala index 7cd9aeaf..d0cabea7 100644 --- a/libdino/src/service/file_manager.vala +++ b/libdino/src/service/file_manager.vala @@ -42,7 +42,7 @@ public class FileManager : StreamInteractionModule, Object { FileTransfer file_transfer = new FileTransfer(); file_transfer.account = conversation.account; file_transfer.counterpart = conversation.counterpart; - if (conversation.type_ in new Conversation.Type[]{Conversation.Type.GROUPCHAT, Conversation.Type.GROUPCHAT_PM}) { + if (conversation.type_.is_muc_semantic()) { file_transfer.ourpart = stream_interactor.get_module(MucManager.IDENTITY).get_own_jid(conversation.counterpart, conversation.account) ?? conversation.account.bare_jid; } else { file_transfer.ourpart = conversation.account.full_jid; @@ -292,7 +292,7 @@ public class FileManager : StreamInteractionModule, Object { file_transfer.account = conversation.account; file_transfer.direction = from.bare_jid.equals(conversation.account.bare_jid) ? FileTransfer.DIRECTION_SENT : FileTransfer.DIRECTION_RECEIVED; file_transfer.counterpart = file_transfer.direction == FileTransfer.DIRECTION_RECEIVED ? from : conversation.counterpart; - if (conversation.type_ in new Conversation.Type[]{Conversation.Type.GROUPCHAT, Conversation.Type.GROUPCHAT_PM}) { + if (conversation.type_.is_muc_semantic()) { file_transfer.ourpart = stream_interactor.get_module(MucManager.IDENTITY).get_own_jid(conversation.counterpart, conversation.account) ?? conversation.account.bare_jid; } else { file_transfer.ourpart = conversation.account.full_jid; diff --git a/libdino/src/service/message_processor.vala b/libdino/src/service/message_processor.vala index a0000936..3959715d 100644 --- a/libdino/src/service/message_processor.vala +++ b/libdino/src/service/message_processor.vala @@ -530,7 +530,7 @@ public class MessageProcessor : StreamInteractionModule, Object { message.local_time = now; message.direction = Entities.Message.DIRECTION_SENT; message.counterpart = conversation.counterpart; - if (conversation.type_ in new Conversation.Type[]{Conversation.Type.GROUPCHAT, Conversation.Type.GROUPCHAT_PM}) { + if (conversation.type_.is_muc_semantic()) { message.ourpart = stream_interactor.get_module(MucManager.IDENTITY).get_own_jid(conversation.counterpart, conversation.account) ?? conversation.account.bare_jid; message.real_jid = conversation.account.bare_jid; } else { |