mirror of
https://github.com/oxen-io/session-android.git
synced 2024-12-24 16:57:50 +00:00
Fix for MMS decoding when no SIM is available.
This commit is contained in:
parent
ff238a1ce9
commit
3ca25de034
@ -28,6 +28,7 @@ import android.util.Pair;
|
|||||||
import org.thoughtcrime.securesms.R;
|
import org.thoughtcrime.securesms.R;
|
||||||
import org.thoughtcrime.securesms.mms.OutgoingGroupMediaMessage;
|
import org.thoughtcrime.securesms.mms.OutgoingGroupMediaMessage;
|
||||||
import org.thoughtcrime.securesms.mms.OutgoingMediaMessage;
|
import org.thoughtcrime.securesms.mms.OutgoingMediaMessage;
|
||||||
|
import org.thoughtcrime.securesms.util.TextSecurePreferences;
|
||||||
import org.whispersystems.textsecure.crypto.InvalidMessageException;
|
import org.whispersystems.textsecure.crypto.InvalidMessageException;
|
||||||
import org.whispersystems.textsecure.crypto.MasterCipher;
|
import org.whispersystems.textsecure.crypto.MasterCipher;
|
||||||
import org.whispersystems.textsecure.crypto.MasterSecret;
|
import org.whispersystems.textsecure.crypto.MasterSecret;
|
||||||
@ -203,13 +204,18 @@ public class MmsDatabase extends Database implements MmsSmsColumns {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (encodedToList != null) {
|
if (encodedToList != null && (encodedToList.length > 1 || group.size() > 1)) {
|
||||||
String localNumber = Util.getDeviceE164Number(context);
|
String localNumber = Util.getDeviceE164Number(context);
|
||||||
|
|
||||||
|
if (localNumber == null) {
|
||||||
|
localNumber = TextSecurePreferences.getLocalNumber(context);
|
||||||
|
}
|
||||||
|
|
||||||
for (EncodedStringValue encodedTo : encodedToList) {
|
for (EncodedStringValue encodedTo : encodedToList) {
|
||||||
String to = new String(encodedTo.getTextString(), CharacterSets.MIMENAME_ISO_8859_1);
|
String to = new String(encodedTo.getTextString(), CharacterSets.MIMENAME_ISO_8859_1);
|
||||||
|
|
||||||
if (!localNumber.equals(to)) {
|
/// TODO format numbers before comparing.
|
||||||
|
if (localNumber == null || !localNumber.equals(to)) {
|
||||||
group.add(to);
|
group.add(to);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user