Skip to content

Commit aae43c0

Browse files
fesaveabelgardep
authored andcommitted
Removed signed in user from the list of users for sharing
1 parent 24de7b3 commit aae43c0

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

owncloudApp/src/main/java/com/owncloud/android/presentation/providers/sharing/UsersAndGroupsSearchProvider.kt

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424

2525
package com.owncloud.android.presentation.providers.sharing
2626

27+
import android.accounts.AccountManager
2728
import android.app.SearchManager
2829
import android.content.ContentProvider
2930
import android.content.ContentValues
@@ -43,6 +44,7 @@ import com.owncloud.android.domain.sharing.sharees.GetShareesAsyncUseCase
4344
import com.owncloud.android.domain.sharing.sharees.model.OCSharee
4445
import com.owncloud.android.domain.sharing.shares.model.ShareType
4546
import com.owncloud.android.extensions.parseError
47+
import com.owncloud.android.lib.common.accounts.AccountUtils.Constants.KEY_DISPLAY_NAME
4648
import org.json.JSONException
4749
import org.koin.android.ext.android.inject
4850
import timber.log.Timber
@@ -178,9 +180,10 @@ class UsersAndGroupsSearchProvider : ContentProvider() {
178180

179181
try {
180182
val userName = AccountUtils.getUsernameOfAccount(account.name)
183+
val fullName = AccountManager.get(context).getUserData(account, KEY_DISPLAY_NAME)
181184
while (namesIt.hasNext()) {
182185
item = namesIt.next()
183-
if (item.label == userName && item.shareType == ShareType.USER) {
186+
if (item.label == userName || item.label == fullName && item.shareType == ShareType.USER) {
184187
continue
185188
}
186189
var userName = item.label

0 commit comments

Comments
 (0)