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 @@ -716,6 +716,10 @@ void User::logout() const
716716
717717QString User::name () const
718718{
719+ if (isPublicShareLink ()) {
720+ return tr (" Public Link" );
721+ }
722+
719723 // If davDisplayName is empty (can be several reasons, simplest is missing login at startup), fall back to username
720724 QString name = _account->account ()->davDisplayName ();
721725 if (name == " " ) {
@@ -726,12 +730,18 @@ QString User::name() const
726730
727731QString User::server (bool shortened) const
728732{
729- QString serverUrl = _account->account ()->url ().toString ();
733+ auto serverUrl = _account->account ()->url ();
734+
735+ if (isPublicShareLink ()) {
736+ serverUrl.setUserName ({});
737+ }
738+ QString stringServerUrl = serverUrl.toString ();
730739 if (shortened) {
731- serverUrl.replace (QLatin1String (" https://" ), QLatin1String (" " ));
732- serverUrl.replace (QLatin1String (" http://" ), QLatin1String (" " ));
740+ stringServerUrl.replace (QLatin1String (" https://" ), QLatin1String (" " ));
741+ stringServerUrl.replace (QLatin1String (" http://" ), QLatin1String (" " ));
742+
733743 }
734- return serverUrl ;
744+ return stringServerUrl ;
735745}
736746
737747UserStatus::OnlineStatus User::status () const
You can’t perform that action at this time.
0 commit comments