aboutsummaryrefslogtreecommitdiff
path: root/libdino/src/service/util.vala
diff options
context:
space:
mode:
authorfiaxh <git@mx.ax.lt>2017-04-04 15:47:00 +0200
committerfiaxh <git@mx.ax.lt>2017-04-04 15:57:35 +0200
commit75e51b5ed3b639b9cf7b16b0ddbee7e362c44ef1 (patch)
treef593528003a5f00268988255904dfc8a6752a779 /libdino/src/service/util.vala
parentea5d3e50c6fd63ae3a151c883f691e76b9cb1018 (diff)
downloaddino-75e51b5ed3b639b9cf7b16b0ddbee7e362c44ef1.tar.gz
dino-75e51b5ed3b639b9cf7b16b0ddbee7e362c44ef1.zip
MessageStorage/Processor, correctly resolve conversations (fixup 22adbd3)
Diffstat (limited to 'libdino/src/service/util.vala')
-rw-r--r--libdino/src/service/util.vala19
1 files changed, 19 insertions, 0 deletions
diff --git a/libdino/src/service/util.vala b/libdino/src/service/util.vala
new file mode 100644
index 00000000..d0e19dc3
--- /dev/null
+++ b/libdino/src/service/util.vala
@@ -0,0 +1,19 @@
+using Dino.Entities;
+
+namespace Dino {
+
+public class Util {
+ public static Entities.Message.Type get_message_type_for_conversation(Conversation conversation) {
+ switch (conversation.type_) {
+ case Conversation.Type.CHAT:
+ return Entities.Message.Type.CHAT;
+ case Conversation.Type.GROUPCHAT:
+ return Entities.Message.Type.GROUPCHAT;
+ case Conversation.Type.GROUPCHAT_PM:
+ return Entities.Message.Type.GROUPCHAT_PM;
+ }
+ assert_not_reached();
+ }
+}
+
+} \ No newline at end of file