Fix InstanceFeatures not correctly using pleroma version

This commit is contained in:
Shadowfacts 2022-11-12 14:34:57 -05:00
parent bf3f735062
commit ccc47e204d
1 changed files with 9 additions and 1 deletions

View File

@ -47,7 +47,7 @@ struct InstanceFeatures {
var reblogVisibility: Bool {
(instanceType == .mastodon && hasVersion(2, 8, 0))
|| (instanceType == .pleroma && hasVersion(2, 0, 0))
|| (instanceType == .pleroma && hasPleromaVersion(2, 0, 0))
}
var probablySupportsMarkdown: Bool {
@ -84,6 +84,14 @@ struct InstanceFeatures {
return false
}
}
func hasPleromaVersion(_ major: Int, _ minor: Int, _ patch: Int) -> Bool {
if let pleromaVersion {
return pleromaVersion >= Version(major, minor, patch)
} else {
return false
}
}
}
extension InstanceFeatures {