Skip to content

Commit

Permalink
Return instance version from server info if available
Browse files Browse the repository at this point in the history
accidentally removed in andregasser#270
  • Loading branch information
PattaFeuFeu committed Oct 15, 2023
1 parent 1d4c306 commit efd1175
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion bigbone/src/main/kotlin/social/bigbone/MastodonClient.kt
Original file line number Diff line number Diff line change
Expand Up @@ -614,11 +614,12 @@ private constructor(
*/
private fun getInstanceVersion(): String {
try {
NodeInfoClient
val serverInfoVersion = NodeInfoClient
.retrieveServerInfo(instanceName)
?.software
?.takeIf { it.name == "mastodon" }
?.version
if (serverInfoVersion != null) return serverInfoVersion
} catch (_: BigBoneRequestException) {
}

Expand Down

0 comments on commit efd1175

Please sign in to comment.