public class CreateShareViaLinkOperation extends SyncOperation {
- private static final int READ_ONLY = 1;
-
protected FileDataStorageManager mStorageManager;
private String mPath;
"",
false,
mPassword,
- READ_ONLY
+ OCShare.DEFAULT_PERMISSION
);
result = operation.execute(client);
}
public Intent getSendIntentWithSubject(Context context) {
if (context != null && mSendIntent != null && mSendIntent.getStringExtra(Intent.EXTRA_SUBJECT) != null) {
- if (getClient() == null || getClient().getCredentials().getUsername() == null) {
+ if (getClient() == null || getClient().getCredentials() == null ||
+ getClient().getCredentials().getUsername() == null) {
mSendIntent.putExtra(
Intent.EXTRA_SUBJECT,
context.getString(R.string.subject_shared_with_you, mFileName)
} else {
share.setIsFolder(false);
}
- share.setPermissions(READ_ONLY);
-
+
getStorageManager().saveShare(share);
// Update OCFile with data from share: ShareByLink and publicLink