MMS group includes the sender

Fixes #6942
// FREEBIE
This commit is contained in:
Moxie Marlinspike
2017-09-08 11:19:57 -07:00
parent 0bd9606666
commit 989ea4042c
2 changed files with 18 additions and 7 deletions

View File

@@ -2,6 +2,7 @@ package org.thoughtcrime.securesms.jobs;
import android.content.Context;
import android.net.Uri;
import android.support.annotation.Nullable;
import android.util.Log;
import com.google.android.mms.pdu_alt.CharacterSets;
@@ -115,7 +116,7 @@ public class MmsDownloadJob extends MasterSecretJob {
throw new MmsException("RetrieveConf was null");
}
storeRetrievedMms(masterSecret, contentLocation, messageId, threadId, retrieveConf, notification.get().getSubscriptionId());
storeRetrievedMms(masterSecret, contentLocation, messageId, threadId, retrieveConf, notification.get().getSubscriptionId(), notification.get().getFrom());
} catch (ApnUnavailableException e) {
Log.w(TAG, e);
handleDownloadError(masterSecret, messageId, threadId, MmsDatabase.Status.DOWNLOAD_APN_UNAVAILABLE,
@@ -163,7 +164,7 @@ public class MmsDownloadJob extends MasterSecretJob {
private void storeRetrievedMms(MasterSecret masterSecret, String contentLocation,
long messageId, long threadId, RetrieveConf retrieved,
int subscriptionId)
int subscriptionId, @Nullable Address notificationFrom)
throws MmsException, NoSessionException, DuplicateMessageException, InvalidMessageException,
LegacyMessageException
{
@@ -178,6 +179,8 @@ public class MmsDownloadJob extends MasterSecretJob {
if (retrieved.getFrom() != null) {
from = Address.fromExternal(context, Util.toIsoString(retrieved.getFrom().getTextString()));
} else if (notificationFrom != null) {
from = notificationFrom;
} else {
from = Address.UNKNOWN;
}
@@ -194,6 +197,7 @@ public class MmsDownloadJob extends MasterSecretJob {
}
}
members.add(from);
members.add(Address.fromExternal(context, TextSecurePreferences.getLocalNumber(context)));
if (retrieved.getBody() != null) {