another.im-ios/AnotherIM/AppData/Model/ServerFeature.swift
2024-10-31 12:43:16 +01:00

22 lines
565 B
Swift

import Foundation
struct ServerFeature: Identifiable & Codable {
let xep: String
let name: String
let xmppId: String?
let description: String?
var id: String { xep }
static var allFeatures: [ServerFeature] {
guard
let url = Bundle.main.url(forResource: "server_features", withExtension: "plist"),
let data = try? Data(contentsOf: url),
let loaded = try? PropertyListDecoder().decode([ServerFeature].self, from: data)
else {
return []
}
return loaded
}
}