1
0
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:
2021-02-16 19:30:06 +01:00
parent 4d885affb9
commit 3a39387365
5 changed files with 299 additions and 11 deletions

View 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,
});
}

View 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);
}