2017-04-04 13:47:00 +00:00
|
|
|
using Dino.Entities;
|
2023-01-06 15:14:47 +00:00
|
|
|
using Qlite;
|
2017-04-04 13:47:00 +00:00
|
|
|
|
|
|
|
namespace Dino {
|
|
|
|
|
|
|
|
public class Util {
|
2020-03-03 14:14:31 +00:00
|
|
|
public static Message.Type get_message_type_for_conversation(Conversation conversation) {
|
2017-04-04 13:47:00 +00:00
|
|
|
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;
|
2021-10-12 14:27:56 +00:00
|
|
|
default:
|
|
|
|
assert_not_reached();
|
2017-04-04 13:47:00 +00:00
|
|
|
}
|
|
|
|
}
|
2020-03-03 14:14:31 +00:00
|
|
|
|
|
|
|
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;
|
2021-10-12 14:27:56 +00:00
|
|
|
default:
|
|
|
|
assert_not_reached();
|
2020-03-03 14:14:31 +00:00
|
|
|
}
|
|
|
|
}
|
2017-04-04 13:47:00 +00:00
|
|
|
}
|
|
|
|
|
2020-03-03 14:14:31 +00:00
|
|
|
}
|