2019-11-23 18:59:55 +00:00
|
|
|
import MessageFormatter from '../helpers/MessageFormatter';
|
|
|
|
|
|
|
|
export default {
|
|
|
|
methods: {
|
2020-08-11 04:27:42 +00:00
|
|
|
formatMessage(message, isATweet) {
|
|
|
|
const messageFormatter = new MessageFormatter(message, isATweet);
|
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
|
|
|
},
|
|
|
|
};
|