|
|
|
@ -67,7 +67,6 @@ import _, {
|
|
|
|
|
map,
|
|
|
|
|
partition,
|
|
|
|
|
pick,
|
|
|
|
|
reduce,
|
|
|
|
|
reject,
|
|
|
|
|
size as lodashSize,
|
|
|
|
|
sortBy,
|
|
|
|
@ -474,7 +473,7 @@ export class MessageModel extends Backbone.Model<MessageAttributes> {
|
|
|
|
|
convoId: this.get('conversationId'),
|
|
|
|
|
};
|
|
|
|
|
if (body) {
|
|
|
|
|
props.text = this.createNonBreakingLastSeparator(body);
|
|
|
|
|
props.text = body;
|
|
|
|
|
}
|
|
|
|
|
if (this.get('isDeleted')) {
|
|
|
|
|
props.isDeleted = this.get('isDeleted');
|
|
|
|
@ -534,16 +533,6 @@ export class MessageModel extends Backbone.Model<MessageAttributes> {
|
|
|
|
|
return props;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public createNonBreakingLastSeparator(text: string) {
|
|
|
|
|
const nbsp = '\xa0';
|
|
|
|
|
const regex = /(\S)( +)(\S+\s*)$/;
|
|
|
|
|
return text.replace(regex, (_match, start, spaces, end) => {
|
|
|
|
|
const newSpaces: any =
|
|
|
|
|
end.length < 12 ? reduce(spaces, accumulator => accumulator + nbsp, '') : spaces;
|
|
|
|
|
return `${start}${newSpaces}${end}`;
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public processQuoteAttachment(attachment: any) {
|
|
|
|
|
const { thumbnail } = attachment;
|
|
|
|
|
const path = thumbnail && thumbnail.path && getAbsoluteAttachmentPath(thumbnail.path);
|
|
|
|
@ -643,7 +632,7 @@ export class MessageModel extends Backbone.Model<MessageAttributes> {
|
|
|
|
|
if (quote.text) {
|
|
|
|
|
// do not show text of not found messages.
|
|
|
|
|
// if the message was deleted better not show it's text content in the message
|
|
|
|
|
quoteProps.text = this.createNonBreakingLastSeparator(sliceQuoteText(quote.text));
|
|
|
|
|
quoteProps.text = sliceQuoteText(quote.text);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const quoteAttachment = firstAttachment
|
|
|
|
|