mirror of
https://github.com/oxen-io/session-android.git
synced 2025-01-12 06:13:42 +00:00
Merge pull request #1140 from psm14/bugs/group_mms_local_number
Also check cc for duplicates in group MMS
This commit is contained in:
commit
2b2da84918
@ -201,20 +201,31 @@ public class MmsDatabase extends Database implements MmsSmsColumns {
|
||||
|
||||
group.add(new String(encodedFrom.getTextString(), CharacterSets.MIMENAME_ISO_8859_1));
|
||||
|
||||
TelephonyManager telephonyManager = (TelephonyManager) context.getSystemService(Context.TELEPHONY_SERVICE);
|
||||
String localNumber = telephonyManager.getLine1Number();
|
||||
|
||||
if (localNumber == null) {
|
||||
localNumber = TextSecurePreferences.getLocalNumber(context);
|
||||
}
|
||||
|
||||
if (encodedCcList != null) {
|
||||
for (EncodedStringValue encodedCc : encodedCcList) {
|
||||
group.add(new String(encodedCc.getTextString(), CharacterSets.MIMENAME_ISO_8859_1));
|
||||
String cc = new String(encodedCc.getTextString(), CharacterSets.MIMENAME_ISO_8859_1);
|
||||
|
||||
PhoneNumberUtil.MatchType match;
|
||||
|
||||
if (localNumber == null) match = PhoneNumberUtil.MatchType.NO_MATCH;
|
||||
else match = PhoneNumberUtil.getInstance().isNumberMatch(localNumber, cc);
|
||||
|
||||
if (match == PhoneNumberUtil.MatchType.NO_MATCH ||
|
||||
match == PhoneNumberUtil.MatchType.NOT_A_NUMBER)
|
||||
{
|
||||
group.add(cc);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (encodedToList != null && (encodedToList.length > 1 || group.size() > 1)) {
|
||||
TelephonyManager telephonyManager = (TelephonyManager) context.getSystemService(Context.TELEPHONY_SERVICE);
|
||||
String localNumber = telephonyManager.getLine1Number();
|
||||
|
||||
if (localNumber == null) {
|
||||
localNumber = TextSecurePreferences.getLocalNumber(context);
|
||||
}
|
||||
|
||||
for (EncodedStringValue encodedTo : encodedToList) {
|
||||
String to = new String(encodedTo.getTextString(), CharacterSets.MIMENAME_ISO_8859_1);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user