change the subject
authorpurigarcia <pgarcia@solidgear.es>
Thu, 9 Jul 2015 08:40:47 +0000 (10:40 +0200)
committerDavid A. Velasco <dvelasco@solidgear.es>
Thu, 6 Aug 2015 08:23:27 +0000 (10:23 +0200)
res/values/strings.xml
src/com/owncloud/android/operations/CreateShareOperation.java

index d7c45b8..dd8ce04 100644 (file)
        <string name="with_you_subject_header">with you</string>
     
        <string name="subject_token">%1$s shared \"%2$s\" with you</string>
+    <string name="saml_subject_token">\"%1$s\" has been shared with you</string>
 
     <string name="auth_refresh_button">Refresh connection</string>
     <string name="auth_host_address">Server address</string>
index 7cdcc08..a7270eb 100644 (file)
@@ -161,9 +161,16 @@ 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);
             getStorageManager().saveFile(file);