~singpolyma/cheogram-android

96024b4453f98a0311e66f0d9c36b964bead86b2 — Stephen Paul Weber 9 days ago d9af801
Properly encode XMPP URIs before sharing
M src/main/java/eu/siacs/conversations/entities/Account.java => src/main/java/eu/siacs/conversations/entities/Account.java +2 -1
@@ 2,6 2,7 @@ package eu.siacs.conversations.entities;

import android.content.ContentValues;
import android.database.Cursor;
import android.net.Uri;
import android.os.SystemClock;
import android.util.Log;



@@ 690,7 691,7 @@ public class Account extends AbstractEntity implements AvatarService.Avatarable 

    public String getShareableUri() {
        List<XmppUri.Fingerprint> fingerprints = this.getFingerprints();
        String uri = "xmpp:" + this.getJid().asBareJid().toEscapedString();
        String uri = "xmpp:" + Uri.encode(getJid().asBareJid().toEscapedString(), "@/");
        if (fingerprints.size() > 0) {
            return XmppUri.getFingerprintUri(uri, fingerprints, ';');
        } else {

M src/main/java/eu/siacs/conversations/ui/ConferenceDetailsActivity.java => src/main/java/eu/siacs/conversations/ui/ConferenceDetailsActivity.java +2 -1
@@ 4,6 4,7 @@ import android.app.Activity;
import android.app.PendingIntent;
import android.content.Context;
import android.content.Intent;
import android.net.Uri;
import android.os.Bundle;
import android.text.Editable;
import android.text.SpannableStringBuilder;


@@ 386,7 387,7 @@ public class ConferenceDetailsActivity extends XmppActivity implements OnConvers
            if (http) {
                return "https://conversations.im/j/" + XmppUri.lameUrlEncode(mConversation.getJid().asBareJid().toEscapedString());
            } else {
                return "xmpp:" + mConversation.getJid().asBareJid() + "?join";
                return "xmpp:" + Uri.encode(mConversation.getJid().asBareJid().toEscapedString(), "@/") + "?join";
            }
        } else {
            return null;

M src/main/java/eu/siacs/conversations/ui/ContactDetailsActivity.java => src/main/java/eu/siacs/conversations/ui/ContactDetailsActivity.java +1 -1
@@ 203,7 203,7 @@ public class ContactDetailsActivity extends OmemoActivity implements OnAccountUp
        if (http) {
            return "https://conversations.im/i/" + XmppUri.lameUrlEncode(contact.getJid().asBareJid().toEscapedString());
        } else {
            return "xmpp:" + contact.getJid().asBareJid().toEscapedString();
            return "xmpp:" + Uri.encode(contact.getJid().asBareJid().toEscapedString(), "@/");
        }
    }