show S3 file transfer in server info if http upload is n/a

This commit is contained in:
Daniel Gultsch 2018-05-26 10:17:24 +02:00
parent ea5cdec186
commit 2d118b5a21
3 changed files with 6 additions and 1 deletions

View File

@ -153,7 +153,7 @@ public class EditAccountActivity extends OmemoActivity implements OnAccountUpdat
boolean openPaymentUrl = mAccount != null && mAccount.getStatus() == Account.State.PAYMENT_REQUIRED; boolean openPaymentUrl = mAccount != null && mAccount.getStatus() == Account.State.PAYMENT_REQUIRED;
final boolean redirectionWorthyStatus = openPaymentUrl || openRegistrationUrl; final boolean redirectionWorthyStatus = openPaymentUrl || openRegistrationUrl;
URL url = connection != null && redirectionWorthyStatus ? connection.getRedirectionUrl() : null; URL url = connection != null && redirectionWorthyStatus ? connection.getRedirectionUrl() : null;
if (url != null && redirectionWorthyStatus && !wasDisabled) { if (url != null && !wasDisabled) {
try { try {
startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse(url.toString()))); startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse(url.toString())));
return; return;
@ -1022,6 +1022,9 @@ public class EditAccountActivity extends OmemoActivity implements OnAccountUpdat
} }
if (features.httpUpload(0)) { if (features.httpUpload(0)) {
this.binding.serverInfoHttpUpload.setText(R.string.server_info_available); this.binding.serverInfoHttpUpload.setText(R.string.server_info_available);
} if (features.p1S3FileTransfer()) {
this.binding.serverInfoHttpUploadDescription.setText(R.string.p1_s3_filetransfer);
this.binding.serverInfoHttpUpload.setText(R.string.server_info_available);
} else { } else {
this.binding.serverInfoHttpUpload.setText(R.string.server_info_unavailable); this.binding.serverInfoHttpUpload.setText(R.string.server_info_unavailable);
} }

View File

@ -451,6 +451,7 @@
android:layout_height="wrap_content"> android:layout_height="wrap_content">
<TextView <TextView
android:id="@+id/server_info_http_upload_description"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:ellipsize="end" android:ellipsize="end"

View File

@ -712,4 +712,5 @@
<string name="pref_use_share_location_plugin_summary">Use the Share Location Plugin instead of the build in map</string> <string name="pref_use_share_location_plugin_summary">Use the Share Location Plugin instead of the build in map</string>
<string name="copy_link">Copy web address</string> <string name="copy_link">Copy web address</string>
<string name="copy_jabber_id">Copy Jabber ID</string> <string name="copy_jabber_id">Copy Jabber ID</string>
<string name="p1_s3_filetransfer">HTTP File Sharing for S3</string>
</resources> </resources>