Fixes to url handling in settings & notification

Signed-off-by: Mario Danic <mario@lovelyhq.com>
This commit is contained in:
Mario Danic 2019-03-31 17:50:29 +02:00
parent 60b340ce89
commit 68586ba901
2 changed files with 3 additions and 3 deletions

View File

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

View File

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