Fix firefish instances not being detected

This commit is contained in:
Shadowfacts 2023-07-22 10:43:52 -07:00
parent 3109aafd20
commit 3d232d81ba
2 changed files with 6 additions and 6 deletions

View File

@ -72,7 +72,7 @@ public class InstanceFeatures: ObservableObject {
public var probablySupportsMarkdown: Bool { public var probablySupportsMarkdown: Bool {
switch instanceType { switch instanceType {
case .pleroma(_), .mastodon(.glitch, _), .mastodon(.hometown(_), _), .calckey(_): case .pleroma(_), .mastodon(.glitch, _), .mastodon(.hometown(_), _), .firefish(_):
return true return true
default: default:
return false return false
@ -195,8 +195,8 @@ public class InstanceFeatures: ObservableObject {
instanceType = .pixelfed instanceType = .pixelfed
} else if nodeInfo?.software.name == "gotosocial" { } else if nodeInfo?.software.name == "gotosocial" {
instanceType = .gotosocial instanceType = .gotosocial
} else if ver.contains("calckey") { } else if ver.contains("firefish") || ver.contains("calckey") {
instanceType = .calckey(nodeInfo?.software.version) instanceType = .firefish(nodeInfo?.software.version)
} else { } else {
instanceType = .mastodon(.vanilla, Version(string: ver)) instanceType = .mastodon(.vanilla, Version(string: ver))
} }
@ -235,7 +235,7 @@ extension InstanceFeatures {
case pleroma(PleromaType) case pleroma(PleromaType)
case pixelfed case pixelfed
case gotosocial case gotosocial
case calckey(String?) case firefish(String?)
var isMastodon: Bool { var isMastodon: Bool {
if case .mastodon(_, _) = self { if case .mastodon(_, _) = self {

View File

@ -153,8 +153,8 @@ private func captureError(_ error: Client.Error, in mastodonController: Mastodon
event.tags!["instance_type"] = "pixelfed" event.tags!["instance_type"] = "pixelfed"
case .gotosocial: case .gotosocial:
event.tags!["instance_type"] = "gotosocial" event.tags!["instance_type"] = "gotosocial"
case .calckey(let calckeyVersion): case .firefish(let calckeyVersion):
event.tags!["instance_type"] = "calckey" event.tags!["instance_type"] = "firefish"
if let calckeyVersion { if let calckeyVersion {
event.tags!["calckey_version"] = calckeyVersion event.tags!["calckey_version"] = calckeyVersion
} }