diff --git a/src/conversations/java/eu/siacs/conversations/ui/EasyOnboardingInviteActivity.java b/src/conversations/java/eu/siacs/conversations/ui/EasyOnboardingInviteActivity.java index 840fd6153..4db0f5bfe 100644 --- a/src/conversations/java/eu/siacs/conversations/ui/EasyOnboardingInviteActivity.java +++ b/src/conversations/java/eu/siacs/conversations/ui/EasyOnboardingInviteActivity.java @@ -68,7 +68,7 @@ public class EasyOnboardingInviteActivity extends XmppActivity implements EasyOn final String shareText = getString( R.string.easy_invite_share_text, easyOnboardingInvite.getDomain(), - easyOnboardingInvite.getLandingUrl() + easyOnboardingInvite.getShareableLink() ); final Intent sendIntent = new Intent(); sendIntent.setAction(Intent.ACTION_SEND); @@ -99,13 +99,7 @@ public class EasyOnboardingInviteActivity extends XmppActivity implements EasyOn final Point size = new Point(); getWindowManager().getDefaultDisplay().getSize(size); final int width = Math.min(size.x, size.y); - final String content; - if (Strings.isNullOrEmpty(invite.getLandingUrl())) { - content = invite.getUri(); - } else { - content = invite.getLandingUrl(); - } - final Bitmap bitmap = BarcodeProvider.create2dBarcodeBitmap(content, width); + final Bitmap bitmap = BarcodeProvider.create2dBarcodeBitmap(invite.getShareableLink(), width); binding.qrCode.setImageBitmap(bitmap); } diff --git a/src/main/java/eu/siacs/conversations/utils/EasyOnboardingInvite.java b/src/main/java/eu/siacs/conversations/utils/EasyOnboardingInvite.java index 954e2c65a..e4ed8e1b5 100644 --- a/src/main/java/eu/siacs/conversations/utils/EasyOnboardingInvite.java +++ b/src/main/java/eu/siacs/conversations/utils/EasyOnboardingInvite.java @@ -3,6 +3,7 @@ package eu.siacs.conversations.utils; import android.os.Parcel; import android.os.Parcelable; +import com.google.common.base.Strings; import com.google.common.collect.ImmutableList; import java.util.Collections; @@ -75,13 +76,11 @@ public class EasyOnboardingInvite implements Parcelable { return supportingAccountsBuilder.build(); } - public String getUri() { - return uri; + + public String getShareableLink() { + return Strings.isNullOrEmpty(landingUrl) ? uri : landingUrl; } - public String getLandingUrl() { - return landingUrl; - } public String getDomain() { return domain;