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

Add new conversation property

This commit is contained in:
2020-04-26 14:02:57 +02:00
parent 8bd937420e
commit 1b5169eb56
5 changed files with 16 additions and 4 deletions

View File

@ -17,6 +17,7 @@ class Conversation extends CacheModel implements Comparable {
final bool following;
final bool sawLastMessage;
final List<int> members;
final bool canEveryoneAddMembers;
final CallCapabilities callCapabilities;
final bool isHavingCall;
@ -28,6 +29,7 @@ class Conversation extends CacheModel implements Comparable {
@required this.following,
@required this.sawLastMessage,
@required this.members,
@required this.canEveryoneAddMembers,
this.callCapabilities = CallCapabilities.NONE,
this.isHavingCall = false,
}) : assert(id != null),
@ -36,6 +38,7 @@ class Conversation extends CacheModel implements Comparable {
assert(following != null),
assert(sawLastMessage != null),
assert(members != null),
assert(canEveryoneAddMembers != null),
assert(callCapabilities != null),
assert(isHavingCall != null),
super(id: id);
@ -55,6 +58,8 @@ class Conversation extends CacheModel implements Comparable {
sawLastMessage = map[ConversationTableContract.C_SAW_LAST_MESSAGE] == 1,
members =
listToIntList(map[ConversationTableContract.C_MEMBERS].split(",")),
canEveryoneAddMembers =
map[ConversationTableContract.C_CAN_EVERYONE_ADD_MEMBERS] == 1,
// By default, we can not do any call
callCapabilities = CallCapabilities.NONE,
@ -71,6 +76,8 @@ class Conversation extends CacheModel implements Comparable {
ConversationTableContract.C_FOLLOWING: following ? 1 : 0,
ConversationTableContract.C_SAW_LAST_MESSAGE: sawLastMessage ? 1 : 0,
ConversationTableContract.C_MEMBERS: members.join(","),
ConversationTableContract.C_CAN_EVERYONE_ADD_MEMBERS:
canEveryoneAddMembers ? 1 : 0
};
}