Skip to content

Commit

Permalink
Merge pull request #3454 from deltachat/adb/update-link-generation
Browse files Browse the repository at this point in the history
remove Util.QrDataToInviteURL()
  • Loading branch information
adbenitez authored Nov 27, 2024
2 parents 2f34a6f + 72ace5c commit 1f880ef
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -533,7 +533,7 @@ private void createChat() {
private void shareInvite() {
Intent intent = new Intent(Intent.ACTION_SEND);
intent.setType("text/plain");
String inviteURL = Util.QrDataToInviteURL(DcHelper.getContext(this).getSecurejoinQr(0));
String inviteURL = DcHelper.getContext(this).getSecurejoinQr(0);
intent.putExtra(Intent.EXTRA_TEXT, getString(R.string.invite_friends_text, inviteURL));
startActivity(Intent.createChooser(intent, getString(R.string.chat_share_with_title)));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ public void shareInviteURL() {
try {
Intent intent = new Intent(Intent.ACTION_SEND);
intent.setType("text/plain");
String inviteURL = Util.QrDataToInviteURL(dcContext.getSecurejoinQr(chatId));
String inviteURL = dcContext.getSecurejoinQr(chatId);
intent.putExtra(Intent.EXTRA_TEXT, inviteURL);
startActivity(Intent.createChooser(intent, getString(R.string.chat_share_with_title)));
} catch (Exception e) {
Expand All @@ -131,7 +131,7 @@ public void shareInviteURL() {
}

public void copyQrData() {
String inviteURL = Util.QrDataToInviteURL(dcContext.getSecurejoinQr(chatId));
String inviteURL = dcContext.getSecurejoinQr(chatId);
Util.writeTextToClipboard(getActivity(), inviteURL);
Toast.makeText(getActivity(), getString(R.string.copied_to_clipboard), Toast.LENGTH_SHORT).show();
}
Expand All @@ -151,7 +151,7 @@ public void withdrawQr() {

public void showInviteLinkDialog() {
View view = View.inflate(getActivity(), R.layout.dialog_share_invite_link, null);
String inviteURL = Util.QrDataToInviteURL(dcContext.getSecurejoinQr(chatId));
String inviteURL = dcContext.getSecurejoinQr(chatId);
((TextView)view.findViewById(R.id.invite_link)).setText(inviteURL);
new AlertDialog.Builder(getActivity())
.setView(view)
Expand Down
4 changes: 0 additions & 4 deletions src/main/java/org/thoughtcrime/securesms/util/Util.java
Original file line number Diff line number Diff line change
Expand Up @@ -85,10 +85,6 @@ public static boolean isInviteURL(String url) {
return false;
}

public static String QrDataToInviteURL(String qrData) {
return "https://" + INVITE_DOMAIN + "/#" + qrData.split(":", 2)[1].replaceFirst("#", "&");
}

public static CharSequence getBoldedString(String value) {
SpannableString spanned = new SpannableString(value);
spanned.setSpan(new StyleSpan(Typeface.BOLD), 0,
Expand Down

0 comments on commit 1f880ef

Please sign in to comment.