summaryrefslogtreecommitdiff
path: root/settings/accounts/ui/mastodon-settings.qml
diff options
context:
space:
mode:
Diffstat (limited to 'settings/accounts/ui/mastodon-settings.qml')
-rw-r--r--settings/accounts/ui/mastodon-settings.qml13
1 files changed, 12 insertions, 1 deletions
diff --git a/settings/accounts/ui/mastodon-settings.qml b/settings/accounts/ui/mastodon-settings.qml
index 630f51d..6b25bb3 100644
--- a/settings/accounts/ui/mastodon-settings.qml
+++ b/settings/accounts/ui/mastodon-settings.qml
@@ -13,7 +13,18 @@ AccountSettingsAgent {
if (credentialsUserName.length > 0) {
return credentialsUserName
}
- return account.displayName
+ var displayName = account.displayName ? account.displayName.toString().trim() : ""
+ if (displayName.length > 0) {
+ return displayName
+ }
+ var apiHost = account.configurationValues("")["api/Host"]
+ var host = apiHost ? apiHost.toString().trim() : ""
+ host = host.replace(/^https?:\/\//i, "")
+ var pathSeparator = host.indexOf("/")
+ if (pathSeparator !== -1) {
+ host = host.substring(0, pathSeparator)
+ }
+ return host
}
Account {