Forráskód Böngészése

Fixes to url handling in settings & notification

Signed-off-by: Mario Danic <mario@lovelyhq.com>
Mario Danic 6 éve
szülő
commit
68586ba901

+ 1 - 1
app/src/main/java/com/nextcloud/talk/controllers/SettingsController.java

@@ -522,7 +522,7 @@ public class SettingsController extends BaseController {
 
         if (currentUser != null) {
 
-            baseUrlTextView.setText(currentUser.getBaseUrl());
+            baseUrlTextView.setText(Uri.parse(currentUser.getBaseUrl()).getHost());
 
             reauthorizeButton.addPreferenceClickListener(view14 -> {
                 getRouter().pushController(RouterTransaction.with(

+ 2 - 2
app/src/main/java/com/nextcloud/talk/jobs/NotificationWorker.java

@@ -266,8 +266,8 @@ public class NotificationWorker extends Worker {
 
         CRC32 crc32 = new CRC32();
 
-        String baseUrl =
-                signatureVerification.getUserEntity().getBaseUrl().substring(signatureVerification.getUserEntity().getBaseUrl().indexOf("://") + 3);
+        Uri uri = Uri.parse(signatureVerification.getUserEntity().getBaseUrl());
+        String baseUrl = uri.getHost();
 
         NotificationCompat.Builder notificationBuilder = new NotificationCompat.Builder(context, "1")
                 .setLargeIcon(largeIcon)