Skip to content

Commit 377935c

Browse files
fix(share): use user name to check visibility of share item
Signed-off-by: Andy Scherzinger <[email protected]>
1 parent 37d096e commit 377935c

File tree

1 file changed

+4
-8
lines changed

1 file changed

+4
-8
lines changed

app/src/main/java/it/niedermann/owncloud/notes/share/adapter/holder/ShareViewHolder.java

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ public ShareViewHolder(ItemShareShareBinding binding,
4848
}
4949

5050
public void bind(OCShare share, ShareeListAdapterListener listener) {
51-
String accountName = account.getDisplayName();
51+
String accountUserName = account.getUserName();
5252
String name = share.getSharedWithDisplayName();
5353
binding.icon.setTag(null);
5454
final var shareType = share.getShareType();
@@ -89,14 +89,10 @@ public void bind(OCShare share, ShareeListAdapterListener listener) {
8989

9090
binding.name.setText(name);
9191

92-
if (accountName == null) {
93-
binding.overflowMenu.setVisibility(View.GONE);
94-
return;
95-
}
96-
97-
if (accountName.equalsIgnoreCase(share.getShareWith()) || accountName.equalsIgnoreCase(share.getUserId())) {
92+
if (accountUserName.equalsIgnoreCase(share.getShareWith()) ||
93+
accountUserName.equalsIgnoreCase(share.getUserId())) {
9894
binding.overflowMenu.setVisibility(View.VISIBLE);
99-
95+
10096
String permissionName = SharingMenuHelper.getPermissionName(context, share);
10197
setPermissionName(permissionName);
10298

0 commit comments

Comments
 (0)