forked from shadowfacts/Tusker
Fix InstanceFeatures not correctly using pleroma version
This commit is contained in:
parent
bf3f735062
commit
ccc47e204d
|
@ -47,7 +47,7 @@ struct InstanceFeatures {
|
||||||
|
|
||||||
var reblogVisibility: Bool {
|
var reblogVisibility: Bool {
|
||||||
(instanceType == .mastodon && hasVersion(2, 8, 0))
|
(instanceType == .mastodon && hasVersion(2, 8, 0))
|
||||||
|| (instanceType == .pleroma && hasVersion(2, 0, 0))
|
|| (instanceType == .pleroma && hasPleromaVersion(2, 0, 0))
|
||||||
}
|
}
|
||||||
|
|
||||||
var probablySupportsMarkdown: Bool {
|
var probablySupportsMarkdown: Bool {
|
||||||
|
@ -84,6 +84,14 @@ struct InstanceFeatures {
|
||||||
return false
|
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 {
|
extension InstanceFeatures {
|
||||||
|
|
Loading…
Reference in New Issue