Add new string for share_groups_indicator
[pub/Android/ownCloud.git] / src / com / owncloud / android / operations / CreateShareOperation.java
index 7cdcc08..ebae9bd 100644 (file)
@@ -161,11 +161,18 @@ public class CreateShareOperation extends SyncOperation {
         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),
-                    getClient().getCredentials().getUsername(), file.getFileName()));
+            if (getClient().getCredentials().getUsername() == null) {
+                //in saml is null
+                mSendIntent.putExtra(Intent.EXTRA_SUBJECT,
+                        String.format(mContext.getString(R.string.saml_subject_token),
+                                file.getFileName()));
+            } else {
+                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);
+            file.setShareViaLink(true);
             getStorageManager().saveFile(file);
             Log_OC.d(TAG, "Public Link = " + file.getPublicLink());