Build shareOwnerAvatar image provider string when handling sharedWithMe share in...
authorClaudio Cambra <claudio.cambra@nextcloud.com>
Sun, 20 Oct 2024 17:48:44 +0000 (01:48 +0800)
committerClaudio Cambra <claudio.cambra@nextcloud.com>
Fri, 22 Nov 2024 08:33:49 +0000 (16:33 +0800)
Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
src/gui/filedetails/sharemodel.cpp

index 27e5df9c94a618eafcba16e466e9b528dcccfc6c..d0eb7fb58765f45944b21c314b095a38881df662 100644 (file)
@@ -491,11 +491,16 @@ void ShareModel::slotSharesFetched(const QList<SharePtr> &shares)
     for (const auto &share : shares) {
         if (share.isNull()) {
             continue;
-        } else if (const auto selfUserId = _accountState->account()->davUser(); share->getUidOwner() != selfUserId) {
+        } else if (const auto selfUserId = share->account()->davUser(); share->getUidOwner() != selfUserId) {
             _displayShareOwner = true;
             Q_EMIT displayShareOwnerChanged();
             _shareOwnerDisplayName = share->getOwnerDisplayName();
             Q_EMIT shareOwnerDisplayNameChanged();
+            _shareOwnerAvatar = "image://avatars/user-id="
+                + share->getUidOwner()
+                + "/local-account:"
+                + share->account()->displayName();
+            Q_EMIT shareOwnerAvatarChanged();
 
             if (share->getShareType() == Share::TypeUser &&
                 share->getShareWith() &&
@@ -513,10 +518,9 @@ void ShareModel::slotSharesFetched(const QList<SharePtr> &shares)
                         : tr("Today");
                 Q_EMIT sharedWithMeRemainingTimeStringChanged();
             }
-            continue;
+        } else {
+            slotAddShare(share);
         }
-
-        slotAddShare(share);
     }
 
     // Perform forward pass on shares and check for duplicate display names; store these indeces so