diff options
author | fiaxh <git@lightrise.org> | 2020-03-03 15:14:31 +0100 |
---|---|---|
committer | fiaxh <git@lightrise.org> | 2020-03-03 15:14:31 +0100 |
commit | b8b3e1c6f517a18a917250f17a64ba1bd19140a8 (patch) | |
tree | d209b6786b75a01d4b5670a125ec945218e686a5 /libdino/src/service/util.vala | |
parent | 17acdd9f414a9e4d6a0607e94b03792581ff03df (diff) | |
download | dino-b8b3e1c6f517a18a917250f17a64ba1bd19140a8.tar.gz dino-b8b3e1c6f517a18a917250f17a64ba1bd19140a8.zip |
Improve MUC message resending
Diffstat (limited to 'libdino/src/service/util.vala')
-rw-r--r-- | libdino/src/service/util.vala | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/libdino/src/service/util.vala b/libdino/src/service/util.vala index d0e19dc3..4f9b94ce 100644 --- a/libdino/src/service/util.vala +++ b/libdino/src/service/util.vala @@ -3,7 +3,7 @@ using Dino.Entities; namespace Dino { public class Util { - public static Entities.Message.Type get_message_type_for_conversation(Conversation conversation) { + public static Message.Type get_message_type_for_conversation(Conversation conversation) { switch (conversation.type_) { case Conversation.Type.CHAT: return Entities.Message.Type.CHAT; @@ -14,6 +14,18 @@ public class Util { } assert_not_reached(); } + + public static Conversation.Type get_conversation_type_for_message(Message message) { + switch (message.type_) { + case Entities.Message.Type.CHAT: + return Conversation.Type.CHAT; + case Entities.Message.Type.GROUPCHAT: + return Conversation.Type.GROUPCHAT; + case Entities.Message.Type.GROUPCHAT_PM: + return Conversation.Type.GROUPCHAT_PM; + } + assert_not_reached(); + } } -}
\ No newline at end of file +} |