2019-11-23 18:59:55 +00:00
|
|
|
import MessageFormatter from '../helpers/MessageFormatter';
|
|
|
|
|
|
|
|
export default {
|
|
|
|
methods: {
|
2022-03-31 14:52:52 +00:00
|
|
|
formatMessage(message, isATweet, isAPrivateNote) {
|
|
|
|
const messageFormatter = new MessageFormatter(
|
|
|
|
message,
|
|
|
|
isATweet,
|
|
|
|
isAPrivateNote
|
|
|
|
);
|
2019-11-23 18:59:55 +00:00
|
|
|
return messageFormatter.formattedMessage;
|
|
|
|
},
|
2021-01-15 09:10:50 +00:00
|
|
|
getPlainText(message, isATweet) {
|
|
|
|
const messageFormatter = new MessageFormatter(message, isATweet);
|
|
|
|
return messageFormatter.plainText;
|
|
|
|
},
|
2020-04-10 11:12:37 +00:00
|
|
|
truncateMessage(description = '') {
|
|
|
|
if (description.length < 100) {
|
|
|
|
return description;
|
|
|
|
}
|
|
|
|
|
|
|
|
return `${description.slice(0, 97)}...`;
|
|
|
|
},
|
2019-11-23 18:59:55 +00:00
|
|
|
},
|
|
|
|
};
|