Skip to content

Commit

Permalink
Return instance version from server info if available (#290)
Browse files Browse the repository at this point in the history
accidentally removed in #270
  • Loading branch information
PattaFeuFeu authored Oct 16, 2023
1 parent d80d2e1 commit 2fa6004
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 @@ -622,11 +622,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 2fa6004

Please sign in to comment.