File tree Expand file tree Collapse file tree 1 file changed +14
-4
lines changed
Expand file tree Collapse file tree 1 file changed +14
-4
lines changed Original file line number Diff line number Diff line change @@ -741,6 +741,10 @@ void User::logout() const
741741
742742QString User::name () const
743743{
744+ if (isPublicShareLink ()) {
745+ return tr (" Public Link" );
746+ }
747+
744748 // If davDisplayName is empty (can be several reasons, simplest is missing login at startup), fall back to username
745749 QString name = _account->account ()->davDisplayName ();
746750 if (name == " " ) {
@@ -751,12 +755,18 @@ QString User::name() const
751755
752756QString User::server (bool shortened) const
753757{
754- QString serverUrl = _account->account ()->url ().toString ();
758+ auto serverUrl = _account->account ()->url ();
759+
760+ if (isPublicShareLink ()) {
761+ serverUrl.setUserName ({});
762+ }
763+ QString stringServerUrl = serverUrl.toString ();
755764 if (shortened) {
756- serverUrl.replace (QLatin1String (" https://" ), QLatin1String (" " ));
757- serverUrl.replace (QLatin1String (" http://" ), QLatin1String (" " ));
765+ stringServerUrl.replace (QLatin1String (" https://" ), QLatin1String (" " ));
766+ stringServerUrl.replace (QLatin1String (" http://" ), QLatin1String (" " ));
767+
758768 }
759- return serverUrl ;
769+ return stringServerUrl ;
760770}
761771
762772UserStatus::OnlineStatus User::status () const
You can’t perform that action at this time.
0 commit comments