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

@ -8,6 +8,8 @@ import 'package:meta/meta.dart';
///
/// @author Pierre HUBERT
enum CallCapabilities { NONE, AUDIO, VIDEO }
class Conversation extends CacheModel implements Comparable {
final int ownerID;
final int lastActive;
@ -15,6 +17,8 @@ class Conversation extends CacheModel implements Comparable {
final bool following;
final bool sawLastMessage;
final List<int> members;
final CallCapabilities callCapabilities;
final bool isHavingCall;
const Conversation({
@required int id,
@ -24,12 +28,16 @@ class Conversation extends CacheModel implements Comparable {
@required this.following,
@required this.sawLastMessage,
@required this.members,
this.callCapabilities = CallCapabilities.NONE,
this.isHavingCall = false,
}) : assert(id != null),
assert(ownerID != null),
assert(lastActive != null),
assert(following != null),
assert(sawLastMessage != null),
assert(members != null),
assert(callCapabilities != null),
assert(isHavingCall != null),
super(id: id);
/// Check out whether a conversation has a fixed name or not
@ -45,8 +53,12 @@ class Conversation extends CacheModel implements Comparable {
name = map[ConversationTableContract.C_NAME],
following = map[ConversationTableContract.C_FOLLOWING] == 1,
sawLastMessage = map[ConversationTableContract.C_SAW_LAST_MESSAGE] == 1,
members = listToIntList(
map[ConversationTableContract.C_MEMBERS].split(",")),
members =
listToIntList(map[ConversationTableContract.C_MEMBERS].split(",")),
// By default, we can not do any call
callCapabilities = CallCapabilities.NONE,
isHavingCall = false,
super.fromMap(map);
@override