MMS and Group Messaging Improvements

1) Display the individual sender name in a group conversation.

2) Add an "address" column to MmsDatabase and keep FROM there.

3) Remove all blocking operations from MmsDatabase.Reader path.

4) Strip SMIL and other undisplayable parts from part count.

5) Fix places where messages weren't being correctly decrypted.
This commit is contained in:
Moxie Marlinspike
2013-05-05 12:51:36 -07:00
parent 2305a648fb
commit 723fb4ffdd
12 changed files with 241 additions and 246 deletions

View File

@@ -73,6 +73,7 @@ public class ConversationItem extends LinearLayout {
private Handler failedIconHandler;
private MessageRecord messageRecord;
private MasterSecret masterSecret;
private boolean groupThread;
private TextView bodyText;
private TextView dateText;
@@ -125,11 +126,13 @@ public class ConversationItem extends LinearLayout {
this.mmsDownloadButton.setOnClickListener(mmsDownloadClickListener);
}
public void set(MasterSecret masterSecret, MessageRecord messageRecord, Handler failedIconHandler)
public void set(MasterSecret masterSecret, MessageRecord messageRecord,
Handler failedIconHandler, boolean groupThread)
{
this.messageRecord = messageRecord;
this.masterSecret = masterSecret;
this.failedIconHandler = failedIconHandler;
this.groupThread = groupThread;
setBodyText(messageRecord);
setStatusIcons(messageRecord);
@@ -201,19 +204,12 @@ public class ConversationItem extends LinearLayout {
}
private void setGroupMessageStatus(MessageRecord messageRecord) {
// GroupData groupData = messageRecord.getGroupData();
//
// if (groupData != null) {
// String status = String.format("Sent (%d/%d)", groupData.groupSentCount, groupData.groupSize);
//
// if (groupData.groupSendFailedCount != 0)
// status = status + String.format(", Failed (%d/%d)", groupData.groupSendFailedCount, groupData.groupSize);
//
// this.groupStatusText.setText(status);
// this.groupStatusText.setVisibility(View.VISIBLE);
// } else {
if (groupThread && !messageRecord.isOutgoing()) {
this.groupStatusText.setText(messageRecord.getIndividualRecipient().toShortString());
this.groupStatusText.setVisibility(View.VISIBLE);
} else {
this.groupStatusText.setVisibility(View.GONE);
// }
}
}
private void setNotificationMmsAttributes(NotificationMmsMessageRecord messageRecord) {
@@ -242,6 +238,8 @@ public class ConversationItem extends LinearLayout {
if (messageRecord.getPartCount() > 0) {
mmsThumbnail.setVisibility(View.VISIBLE);
mmsThumbnail.setImageDrawable(new ColorDrawable(Color.TRANSPARENT));
} else {
mmsThumbnail.setVisibility(View.GONE);
}
slideDeck = messageRecord.getSlideDeck();