2019-02-26 19:29:52 -08:00
|
|
|
package org.thoughtcrime.securesms.longmessage;
|
|
|
|
|
2019-03-01 18:14:47 -08:00
|
|
|
import android.text.TextUtils;
|
|
|
|
|
2019-02-26 19:29:52 -08:00
|
|
|
import org.thoughtcrime.securesms.database.model.MessageRecord;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* A wrapper around a {@link MessageRecord} and its extra text attachment expanded into a string
|
|
|
|
* held in memory.
|
|
|
|
*/
|
|
|
|
class LongMessage {
|
|
|
|
|
|
|
|
private final MessageRecord messageRecord;
|
2019-03-01 18:14:47 -08:00
|
|
|
private final String fullBody;
|
2019-02-26 19:29:52 -08:00
|
|
|
|
2019-03-01 18:14:47 -08:00
|
|
|
LongMessage(MessageRecord messageRecord, String fullBody) {
|
2019-02-26 19:29:52 -08:00
|
|
|
this.messageRecord = messageRecord;
|
2019-03-01 18:14:47 -08:00
|
|
|
this.fullBody = fullBody;
|
2019-02-26 19:29:52 -08:00
|
|
|
}
|
|
|
|
|
|
|
|
MessageRecord getMessageRecord() {
|
|
|
|
return messageRecord;
|
|
|
|
}
|
|
|
|
|
|
|
|
String getFullBody() {
|
2019-03-01 18:14:47 -08:00
|
|
|
return !TextUtils.isEmpty(fullBody) ? fullBody : messageRecord.getBody();
|
2019-02-26 19:29:52 -08:00
|
|
|
}
|
|
|
|
}
|