Add sterner warning about post content type

This commit is contained in:
Shadowfacts 2022-11-01 22:43:02 -04:00
parent abb8352c92
commit c7f3bac330
2 changed files with 15 additions and 1 deletions

View File

@ -50,6 +50,10 @@ struct InstanceFeatures {
|| (instanceType == .pleroma && hasVersion(2, 0, 0))
}
var probablySupportsMarkdown: Bool {
instanceType == .pleroma || instanceType == .glitch || instanceType == .hometown
}
mutating func update(instance: Instance, nodeInfo: NodeInfo?) {
let ver = instance.version.lowercased()
if ver.contains("glitch") {

View File

@ -23,7 +23,17 @@ struct AdvancedPrefsView : View {
}
var formattingFooter: some View {
Text("This option is only supported for Pleroma and Mastodon instances with formatting enabled. On all other instances, formatting symbols will remain in the unformatted plain text.").lineLimit(nil)
var s: AttributedString = "This option is only supported with Pleroma and some compatible Mastodon instances (such as Glitch or Hometown).\n"
if let account = LocalData.shared.getMostRecentAccount() {
let mastodonController = MastodonController.getForAccount(account)
// shouldn't need to load the instance here, because loading it is kicked off my the scene delegate
if !mastodonController.instanceFeatures.probablySupportsMarkdown {
var warning = AttributedString("\(account.instanceURL.host!) does not appear to support formatting. Using formatting symbols may not have an effect.")
warning[AttributeScopes.SwiftUIAttributes.FontAttribute.self] = .caption.bold()
s += warning
}
}
return Text(s).lineLimit(nil)
}
var formattingSection: some View {