1
0
mirror of https://gitlab.com/comunic/comunicmobile synced 2025-06-19 00:05:16 +00:00

Get call status from server

This commit is contained in:
2020-04-20 10:37:59 +02:00
parent 5eaf8d6b72
commit f227209e9b
3 changed files with 29 additions and 11 deletions

View File

@ -208,14 +208,19 @@ class ConversationsHelper {
/// Turn an API entry into a [Conversation] object
Conversation _apiToConversation(Map<String, dynamic> map) {
return Conversation(
id: map["ID"],
ownerID: map["ID_owner"],
lastActive: map["last_active"],
name: map["name"] == false ? null : map["name"],
following: map["following"] == 1,
sawLastMessage: map["saw_last_message"] == 1,
members: List<int>.from(map["members"]),
);
id: map["ID"],
ownerID: map["ID_owner"],
lastActive: map["last_active"],
name: map["name"] == false ? null : map["name"],
following: map["following"] == 1,
sawLastMessage: map["saw_last_message"] == 1,
members: List<int>.from(map["members"]),
callCapabilities: map["can_have_video_call"]
? CallCapabilities.VIDEO
: (map["can_have_call"]
? CallCapabilities.AUDIO
: CallCapabilities.NONE),
isHavingCall: map["has_call_now"]);
}
/// Parse a list of messages given by the server