MESSENGER-5892 activate federation with wellknown

This commit is contained in:
JanNiklas Grabowski
2024-03-28 16:47:09 +01:00
parent e18e64d1c8
commit 6de4679041
3 changed files with 27 additions and 5 deletions

View File

@@ -50,4 +50,15 @@ struct WellknownFederation: Decodable {
case showIntroduction = "show_introduction"
case enable
}
init(from decoder: Decoder) throws {
let container = try decoder.container(keyedBy: CodingKeys.self)
enable = try? container.decode(Bool.self, forKey: .enable)
showIntroduction = try? container.decode(Bool.self, forKey: .showIntroduction)
showAnnouncement = try? container.decode(Bool.self, forKey: .showAnnouncement)
// Save federation status in userDetaults
BWIBuildSettings.shared.isWellknownFederationEnabled = enable ?? false
}
}