forked from shadowfacts/Tusker
Add sterner warning about post content type
This commit is contained in:
parent
abb8352c92
commit
c7f3bac330
|
@ -50,6 +50,10 @@ struct InstanceFeatures {
|
||||||
|| (instanceType == .pleroma && hasVersion(2, 0, 0))
|
|| (instanceType == .pleroma && hasVersion(2, 0, 0))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var probablySupportsMarkdown: Bool {
|
||||||
|
instanceType == .pleroma || instanceType == .glitch || instanceType == .hometown
|
||||||
|
}
|
||||||
|
|
||||||
mutating func update(instance: Instance, nodeInfo: NodeInfo?) {
|
mutating func update(instance: Instance, nodeInfo: NodeInfo?) {
|
||||||
let ver = instance.version.lowercased()
|
let ver = instance.version.lowercased()
|
||||||
if ver.contains("glitch") {
|
if ver.contains("glitch") {
|
||||||
|
|
|
@ -23,7 +23,17 @@ struct AdvancedPrefsView : View {
|
||||||
}
|
}
|
||||||
|
|
||||||
var formattingFooter: some 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 {
|
var formattingSection: some View {
|
||||||
|
|
Loading…
Reference in New Issue