<string name="search_users_and_groups_hint">Search users and groups</string>
<string name="share_group_clarification">%1$s (group)</string>
+ <string name="share_sharee_unavailable">Sorry, your server version does not allow share with users within clients.
+ \nPlease contact your administrator</string>
+
</resources>
* @param toHide List to save the options that must be shown in the menu.
*/
private void filter(List<Integer> toShow, List <Integer> toHide) {
- boolean shareWithUsersEnable = false;
boolean synchronizing = false;
if (mComponentsGetter != null && mFile != null && mAccount != null) {
OperationsServiceBinder opsBinder = mComponentsGetter.getOperationsServiceBinder();
// uploading
(uploaderBinder != null && uploaderBinder.isUploading(mAccount, mFile))
);
- shareWithUsersEnable = AccountUtils.hasSearchUsersSupport(mAccount);
}
/// decision is taken for each possible action on a file in the menu
}
// SHARE FILE, with Users
- if (!shareAllowed || !shareWithUsersEnable || mFile == null) {
+ if (!shareAllowed || mFile == null) {
toHide.add(R.id.action_share_with_users);
} else {
toShow.add(R.id.action_share_with_users);
import android.widget.ImageView;
import android.widget.ListView;
import android.widget.TextView;
+import android.widget.Toast;
import com.owncloud.android.R;
+import com.owncloud.android.authentication.AccountUtils;
import com.owncloud.android.datamodel.OCFile;
import com.owncloud.android.datamodel.ThumbnailsCacheManager;
import com.owncloud.android.lib.common.utils.Log_OC;
addUserGroupButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
- // Show Search Fragment
- mListener.showSearchUsersAndGroups(mShares);
+ boolean shareWithUsersEnable = AccountUtils.hasSearchUsersSupport(mAccount);
+ if (shareWithUsersEnable) {
+ // Show Search Fragment
+ mListener.showSearchUsersAndGroups(mShares);
+ } else {
+ String message = getString(R.string.share_sharee_unavailable);
+ Toast.makeText(getActivity(), message, Toast.LENGTH_LONG).show();
+ }
}
});