mirror of
				https://gitlab.com/comunic/comunicmobile
				synced 2025-11-04 12:14:11 +00:00 
			
		
		
		
	Start to display banner
This commit is contained in:
		@@ -17,6 +17,7 @@ class ServerConfigurationHelper {
 | 
			
		||||
        (await APIRequest.withoutLogin("server/config").execWithThrow())
 | 
			
		||||
            .getObject();
 | 
			
		||||
 | 
			
		||||
    final banner = response["banner"];
 | 
			
		||||
    final pushNotificationsPolicy = response["push_notifications"];
 | 
			
		||||
    final passwordPolicy = response["password_policy"];
 | 
			
		||||
    final dataConservationPolicy = response["data_conservation_policy"];
 | 
			
		||||
@@ -31,6 +32,15 @@ class ServerConfigurationHelper {
 | 
			
		||||
      contactEmail: response["contact_email"],
 | 
			
		||||
      playStoreURL: response["play_store_url"],
 | 
			
		||||
      androidDirectDownloadURL: response["android_direct_download_url"],
 | 
			
		||||
      banner: banner == null
 | 
			
		||||
          ? null
 | 
			
		||||
          : Banner(
 | 
			
		||||
              enabled: banner["enabled"],
 | 
			
		||||
              expire: banner["expire"],
 | 
			
		||||
              nature: BannerNatureExt.fromStr(banner["nature"]),
 | 
			
		||||
              message: Map<String, dynamic>.from(banner["message"])
 | 
			
		||||
                  .map((key, value) => MapEntry(key, value.toString())),
 | 
			
		||||
              link: banner["link"]),
 | 
			
		||||
      notificationsPolicy: NotificationsPolicy(
 | 
			
		||||
        hasFirebase: pushNotificationsPolicy["has_firebase"],
 | 
			
		||||
        hasIndependent: pushNotificationsPolicy["has_independent"],
 | 
			
		||||
@@ -98,3 +108,5 @@ class ServerConfigurationHelper {
 | 
			
		||||
 | 
			
		||||
/// Shortcut for server configuration
 | 
			
		||||
ServerConfig get srvConfig => ServerConfigurationHelper.config;
 | 
			
		||||
 | 
			
		||||
bool get showBanner => srvConfig.banner != null && srvConfig.banner.visible;
 | 
			
		||||
		Reference in New Issue
	
	Block a user