mirror of
https://gitlab.com/comunic/comunicmobile
synced 2025-06-19 00:05:16 +00:00
Start to integrate data conservation policy
This commit is contained in:
21
lib/models/data_conservation_policy_settings.dart
Normal file
21
lib/models/data_conservation_policy_settings.dart
Normal file
@ -0,0 +1,21 @@
|
||||
/// Data conservation policy settings
|
||||
///
|
||||
/// @author Pierre Hubert
|
||||
|
||||
class DataConservationPolicySettings {
|
||||
int inactiveAccountLifeTime;
|
||||
int notificationLifetime;
|
||||
int commentsLifetime;
|
||||
int postsLifetime;
|
||||
int conversationMessagesLifetime;
|
||||
int likesLifetime;
|
||||
|
||||
DataConservationPolicySettings({
|
||||
this.inactiveAccountLifeTime,
|
||||
this.notificationLifetime,
|
||||
this.commentsLifetime,
|
||||
this.postsLifetime,
|
||||
this.conversationMessagesLifetime,
|
||||
this.likesLifetime,
|
||||
});
|
||||
}
|
36
lib/models/server_config.dart
Normal file
36
lib/models/server_config.dart
Normal file
@ -0,0 +1,36 @@
|
||||
import 'package:flutter/widgets.dart';
|
||||
|
||||
/// Server static configuration
|
||||
///
|
||||
/// @author Pierre Hubert
|
||||
|
||||
class ServerDataConservationPolicy {
|
||||
final int minInactiveAccountLifetime;
|
||||
final int minNotificationLifetime;
|
||||
final int minCommentsLifetime;
|
||||
final int minPostsLifetime;
|
||||
final int minConversationMessagesLifetime;
|
||||
final int minLikesLifetime;
|
||||
|
||||
const ServerDataConservationPolicy({
|
||||
@required this.minInactiveAccountLifetime,
|
||||
@required this.minNotificationLifetime,
|
||||
@required this.minCommentsLifetime,
|
||||
@required this.minPostsLifetime,
|
||||
@required this.minConversationMessagesLifetime,
|
||||
@required this.minLikesLifetime,
|
||||
}) : assert(minInactiveAccountLifetime != null),
|
||||
assert(minNotificationLifetime != null),
|
||||
assert(minCommentsLifetime != null),
|
||||
assert(minPostsLifetime != null),
|
||||
assert(minConversationMessagesLifetime != null),
|
||||
assert(minLikesLifetime != null);
|
||||
}
|
||||
|
||||
class ServerConfig {
|
||||
final ServerDataConservationPolicy dataConservationPolicy;
|
||||
|
||||
const ServerConfig({
|
||||
@required this.dataConservationPolicy,
|
||||
}) : assert(dataConservationPolicy != null);
|
||||
}
|
Reference in New Issue
Block a user