mirror of
https://gitlab.com/comunic/comunicmobile
synced 2025-06-19 00:05:16 +00:00
Can update a conversation
This commit is contained in:
@ -1,5 +1,6 @@
|
||||
import 'package:comunic/helpers/database/database_contract.dart';
|
||||
import 'package:comunic/models/cache_model.dart';
|
||||
import 'package:comunic/utils/account_utils.dart';
|
||||
import 'package:comunic/utils/list_utils.dart';
|
||||
import 'package:meta/meta.dart';
|
||||
|
||||
@ -34,6 +35,10 @@ class Conversation extends CacheModel implements Comparable {
|
||||
/// Check out whether a conversation has a fixed name or not
|
||||
bool get hasName => this.name != null;
|
||||
|
||||
/// Check out whether current user of the application is the owner of it or
|
||||
/// not
|
||||
bool get isOwner => this.ownerID == userID();
|
||||
|
||||
Conversation.fromMap(Map<String, dynamic> map)
|
||||
: ownerID = map[ConversationTableContract.C_OWNER_ID],
|
||||
lastActive = map[ConversationTableContract.C_LAST_ACTIVE],
|
||||
|
@ -1,27 +0,0 @@
|
||||
import 'package:meta/meta.dart';
|
||||
|
||||
/// Conversation settings model
|
||||
///
|
||||
/// Use this model to create / update a conversation
|
||||
///
|
||||
/// @author Pierre HUBERT
|
||||
|
||||
class ConversationSettings {
|
||||
/// Set the ID to 0 if not required
|
||||
final int id;
|
||||
final String name;
|
||||
final bool following;
|
||||
final List<int> members;
|
||||
|
||||
ConversationSettings({
|
||||
@required this.id,
|
||||
@required this.name,
|
||||
@required this.following,
|
||||
@required this.members,
|
||||
}) : assert(members != null && members.length > 0),
|
||||
assert(following != null);
|
||||
|
||||
bool get hasName => name != null && name.length > 0;
|
||||
|
||||
bool get hasId => id != null && id > 0;
|
||||
}
|
Reference in New Issue
Block a user