import android.content.Context;
import android.content.Intent;
-import com.owncloud.android.MainApp;
import com.owncloud.android.R;
import com.owncloud.android.datamodel.FileDataStorageManager;
import com.owncloud.android.datamodel.OCFile;
// Check if the share link already exists
operation = new GetRemoteSharesForFileOperation(mPath, false, false);
RemoteOperationResult result =
- ((GetRemoteSharesForFileOperation)operation).execute(client, MainApp.getUserAgent());
+ ((GetRemoteSharesForFileOperation)operation).execute(client);
if (!result.isSuccess() || result.getData().size() <= 0) {
operation = new CreateRemoteShareOperation(mPath, mShareType, mShareWith, mPublicUpload,
mPassword, mPermissions);
- result = ((CreateRemoteShareOperation)operation).execute(client, MainApp.getUserAgent());
+ result = ((CreateRemoteShareOperation)operation).execute(client);
}
if (result.isSuccess()) {
OCFile file = getStorageManager().getFileByPath(mPath);
if (file!=null) {
mSendIntent.putExtra(Intent.EXTRA_TEXT, share.getShareLink());
- mSendIntent.putExtra(Intent.EXTRA_SUBJECT, String.format(mContext.getString(R.string.subject_token),
+ mSendIntent.putExtra(Intent.EXTRA_SUBJECT,
+ String.format(mContext.getString(R.string.subject_token),
getClient().getCredentials().getUsername(), file.getFileName()));
file.setPublicLink(share.getShareLink());
file.setShareByLink(true);