Merge branch 'master' of https://github.com/fraction/oasis into subscribed-channels
This commit is contained in:
commit
4e8f7426a4
|
@ -3099,6 +3099,11 @@
|
||||||
"inherits": "^2.0.3"
|
"inherits": "^2.0.3"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"define-lazy-prop": {
|
||||||
|
"version": "2.0.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/define-lazy-prop/-/define-lazy-prop-2.0.0.tgz",
|
||||||
|
"integrity": "sha512-Ds09qNh8yw3khSjiJjiUInaGX9xlqZDY7JVryGxdxV7NPeuqQfplOpQ66yJFZut3jLa5zOwkXw1g9EI2uKh4Og=="
|
||||||
|
},
|
||||||
"define-properties": {
|
"define-properties": {
|
||||||
"version": "1.1.3",
|
"version": "1.1.3",
|
||||||
"resolved": "https://registry.npmjs.org/define-properties/-/define-properties-1.1.3.tgz",
|
"resolved": "https://registry.npmjs.org/define-properties/-/define-properties-1.1.3.tgz",
|
||||||
|
@ -7919,12 +7924,13 @@
|
||||||
"integrity": "sha1-Kv3oTQPlC5qO3EROMGEKcCle37Q="
|
"integrity": "sha1-Kv3oTQPlC5qO3EROMGEKcCle37Q="
|
||||||
},
|
},
|
||||||
"open": {
|
"open": {
|
||||||
"version": "7.4.2",
|
"version": "8.0.1",
|
||||||
"resolved": "https://registry.npmjs.org/open/-/open-7.4.2.tgz",
|
"resolved": "https://registry.npmjs.org/open/-/open-8.0.1.tgz",
|
||||||
"integrity": "sha512-MVHddDVweXZF3awtlAS+6pgKLlm/JgxZ90+/NBurBoQctVOOB/zDdVjcyPzQ+0laDGbsWgrRkflI65sQeOgT9Q==",
|
"integrity": "sha512-VfWbDBAay2Zbw2QrMMIxuo4H0SUe+TdHHT8qLkbBRF+TxdEhnbDxf7jWMV5Fbk5U4HX3abq2lvYH5v/xoo6CNg==",
|
||||||
"requires": {
|
"requires": {
|
||||||
"is-docker": "^2.0.0",
|
"define-lazy-prop": "^2.0.0",
|
||||||
"is-wsl": "^2.1.1"
|
"is-docker": "^2.1.1",
|
||||||
|
"is-wsl": "^2.2.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"opener": {
|
"opener": {
|
||||||
|
|
|
@ -36,7 +36,7 @@
|
||||||
"lodash": "^4.17.11",
|
"lodash": "^4.17.11",
|
||||||
"lodash.shuffle": "^4.2.0",
|
"lodash.shuffle": "^4.2.0",
|
||||||
"markdown-it": "^12.0.2",
|
"markdown-it": "^12.0.2",
|
||||||
"open": "^7.0.3",
|
"open": "^8.0.1",
|
||||||
"piexifjs": "^1.0.4",
|
"piexifjs": "^1.0.4",
|
||||||
"pretty-ms": "^7.0.1",
|
"pretty-ms": "^7.0.1",
|
||||||
"pull-abortable": "^4.1.1",
|
"pull-abortable": "^4.1.1",
|
||||||
|
|
|
@ -667,6 +667,10 @@ section.post-preview > section > footer {
|
||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
section.post.blocked {
|
||||||
|
font-style: italic;
|
||||||
|
}
|
||||||
|
|
||||||
section > footer > div > a:hover,
|
section > footer > div > a:hover,
|
||||||
section > footer > div > form > button:hover {
|
section > footer > div > form > button:hover {
|
||||||
text-decoration: underline;
|
text-decoration: underline;
|
||||||
|
|
|
@ -866,6 +866,11 @@ module.exports = ({ cooler, isPublic }) => {
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const { blocking } = await models.friend.getRelationship(
|
||||||
|
msg.value.author
|
||||||
|
);
|
||||||
|
lodash.set(msg, "value.meta.blocking", blocking);
|
||||||
|
|
||||||
return msg;
|
return msg;
|
||||||
})
|
})
|
||||||
);
|
);
|
||||||
|
|
|
@ -75,6 +75,7 @@ const i18n = {
|
||||||
relationshipFollowing: "You are following",
|
relationshipFollowing: "You are following",
|
||||||
relationshipYou: "This is you",
|
relationshipYou: "This is you",
|
||||||
relationshipBlocking: "You are blocking",
|
relationshipBlocking: "You are blocking",
|
||||||
|
relationshipBlockingPost: "This message hides content from a blocked user.",
|
||||||
relationshipNone: "You are neither following or blocking",
|
relationshipNone: "You are neither following or blocking",
|
||||||
relationshipConflict: "You are somehow both following and blocking",
|
relationshipConflict: "You are somehow both following and blocking",
|
||||||
// author view
|
// author view
|
||||||
|
|
|
@ -220,6 +220,7 @@ const thread = (messages) => {
|
||||||
const isAncestor = Boolean(
|
const isAncestor = Boolean(
|
||||||
lodash.get(currentMsg, "value.meta.thread.ancestorOfTarget", false)
|
lodash.get(currentMsg, "value.meta.thread.ancestorOfTarget", false)
|
||||||
);
|
);
|
||||||
|
const isBlocked = Boolean(nextMsg.value.meta.blocking);
|
||||||
msgList.push(`<div class="indent"><details ${isAncestor ? "open" : ""}>`);
|
msgList.push(`<div class="indent"><details ${isAncestor ? "open" : ""}>`);
|
||||||
|
|
||||||
const nextAuthor = lodash.get(nextMsg, "value.meta.author.name");
|
const nextAuthor = lodash.get(nextMsg, "value.meta.author.name");
|
||||||
|
@ -228,8 +229,13 @@ const thread = (messages) => {
|
||||||
? lodash.get(nextMsg, "value.content.contentWarning")
|
? lodash.get(nextMsg, "value.content.contentWarning")
|
||||||
: lodash.get(nextMsg, "value.content.text")
|
: lodash.get(nextMsg, "value.content.text")
|
||||||
);
|
);
|
||||||
|
msgList.push(
|
||||||
msgList.push(summary(`${nextAuthor}: ${nextSnippet}`).outerHTML);
|
summary(
|
||||||
|
isBlocked
|
||||||
|
? i18n.relationshipBlockingPost
|
||||||
|
: `${nextAuthor}: ${nextSnippet}`
|
||||||
|
).outerHTML
|
||||||
|
);
|
||||||
} else if (depth(currentMsg) > depth(nextMsg)) {
|
} else if (depth(currentMsg) > depth(nextMsg)) {
|
||||||
// getting more shallow
|
// getting more shallow
|
||||||
const diffDepth = depth(currentMsg) - depth(nextMsg);
|
const diffDepth = depth(currentMsg) - depth(nextMsg);
|
||||||
|
@ -353,6 +359,7 @@ const post = ({ msg, aside = false }) => {
|
||||||
};
|
};
|
||||||
|
|
||||||
const isPrivate = Boolean(msg.value.meta.private);
|
const isPrivate = Boolean(msg.value.meta.private);
|
||||||
|
const isBlocked = Boolean(msg.value.meta.blocking);
|
||||||
const isRoot = msg.value.content.root == null;
|
const isRoot = msg.value.content.root == null;
|
||||||
const isFork = msg.value.meta.postType === "subtopic";
|
const isFork = msg.value.meta.postType === "subtopic";
|
||||||
const hasContentWarning =
|
const hasContentWarning =
|
||||||
|
@ -438,6 +445,17 @@ const post = ({ msg, aside = false }) => {
|
||||||
)
|
)
|
||||||
: article({ class: "content", innerHTML: markdownContent });
|
: article({ class: "content", innerHTML: markdownContent });
|
||||||
|
|
||||||
|
if (isBlocked) {
|
||||||
|
messageClasses.push("blocked");
|
||||||
|
return section(
|
||||||
|
{
|
||||||
|
id: msg.key,
|
||||||
|
class: messageClasses.join(" "),
|
||||||
|
},
|
||||||
|
i18n.relationshipBlockingPost
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
const articleContent = hasContentWarning
|
const articleContent = hasContentWarning
|
||||||
? details(summary(msg.value.content.contentWarning), articleElement)
|
? details(summary(msg.value.content.contentWarning), articleElement)
|
||||||
: articleElement;
|
: articleElement;
|
||||||
|
|
Loading…
Reference in New Issue