aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/modules/statuses.js9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/modules/statuses.js b/src/modules/statuses.js
index 6fe2558c..5e3a373a 100644
--- a/src/modules/statuses.js
+++ b/src/modules/statuses.js
@@ -114,6 +114,15 @@ export const findMaxId = (...args) => {
return (maxBy(flatten(args), 'id') || {}).id
}
+export const prepareStatus = (status) => {
+ if (status.nsfw === undefined) {
+ const nsfwRegex = /#nsfw/i
+ status.nsfw = !!status.text.match(nsfwRegex)
+ }
+
+ return status
+}
+
export const mutations = {
addNewStatuses (state, { statuses, showImmediately = false, timeline }) {
const timelineObject = state.timelines[timeline]