diff options
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 +} |