mirror of
https://github.com/oxen-io/session-android.git
synced 2024-11-23 18:15:22 +00:00
parent
1a7ab6346f
commit
ff4929fcce
@ -19,6 +19,7 @@ import org.thoughtcrime.securesms.sms.OutgoingTextMessage;
|
|||||||
import org.thoughtcrime.securesms.util.Rfc5724Uri;
|
import org.thoughtcrime.securesms.util.Rfc5724Uri;
|
||||||
|
|
||||||
import java.net.URISyntaxException;
|
import java.net.URISyntaxException;
|
||||||
|
import java.net.URLDecoder;
|
||||||
|
|
||||||
public class QuickResponseService extends MasterSecretIntentService {
|
public class QuickResponseService extends MasterSecretIntentService {
|
||||||
|
|
||||||
@ -44,7 +45,11 @@ public class QuickResponseService extends MasterSecretIntentService {
|
|||||||
try {
|
try {
|
||||||
Rfc5724Uri uri = new Rfc5724Uri(intent.getDataString());
|
Rfc5724Uri uri = new Rfc5724Uri(intent.getDataString());
|
||||||
String content = intent.getStringExtra(Intent.EXTRA_TEXT);
|
String content = intent.getStringExtra(Intent.EXTRA_TEXT);
|
||||||
Recipients recipients = RecipientFactory.getRecipientsFromString(this, uri.getPath(), false);
|
String numbers = uri.getPath();
|
||||||
|
if(numbers.contains("%")){
|
||||||
|
numbers = URLDecoder.decode(numbers);
|
||||||
|
}
|
||||||
|
Recipients recipients = RecipientFactory.getRecipientsFromString(this, numbers, false);
|
||||||
|
|
||||||
if (!TextUtils.isEmpty(content)) {
|
if (!TextUtils.isEmpty(content)) {
|
||||||
if (recipients.isSingleRecipient()) {
|
if (recipients.isSingleRecipient()) {
|
||||||
|
@ -65,6 +65,7 @@ public class Rfc5724UriTest extends TextSecureTestCase {
|
|||||||
public void testGetPath() throws Exception {
|
public void testGetPath() throws Exception {
|
||||||
final String[][] uriTestPairs = {
|
final String[][] uriTestPairs = {
|
||||||
{"sms:+15555555555", "+15555555555"},
|
{"sms:+15555555555", "+15555555555"},
|
||||||
|
{"sms:%2B49555555555", "%2B555555555"},
|
||||||
{"smsto:+15555555555?", "+15555555555"},
|
{"smsto:+15555555555?", "+15555555555"},
|
||||||
{"mms:+15555555555?a=b", "+15555555555"},
|
{"mms:+15555555555?a=b", "+15555555555"},
|
||||||
{"mmsto:+15555555555?a=b&c=d", "+15555555555"},
|
{"mmsto:+15555555555?a=b&c=d", "+15555555555"},
|
||||||
|
Loading…
Reference in New Issue
Block a user