|
|
@@ -45,10 +45,7 @@ module.exports = function(crowi) {
|
|
|
};
|
|
|
|
|
|
const convertMarkdownToMarkdown = function(body) {
|
|
|
- var url = '';
|
|
|
- if (config.crowi && config.crowi['app:siteUrl:fixed']) {
|
|
|
- url = config.crowi['app:siteUrl:fixed'];
|
|
|
- }
|
|
|
+ const url = crowi.configManager.getSiteUrl();
|
|
|
|
|
|
body = body
|
|
|
.replace(/\n\*\s(.+)/g, '\n• $1')
|
|
|
@@ -113,7 +110,7 @@ module.exports = function(crowi) {
|
|
|
};
|
|
|
|
|
|
const prepareSlackMessageForPage = function(page, user, channel, updateType, previousRevision) {
|
|
|
- const url = config.crowi['app:siteUrl:fixed'] || '';
|
|
|
+ const url = crowi.configManager.getSiteUrl();
|
|
|
let body = page.revision.body;
|
|
|
|
|
|
if (updateType == 'create') {
|
|
|
@@ -148,7 +145,7 @@ module.exports = function(crowi) {
|
|
|
};
|
|
|
|
|
|
const prepareSlackMessageForComment = function(comment, user, channel, path) {
|
|
|
- const url = config.crowi['app:siteUrl:fixed'] || '';
|
|
|
+ const url = crowi.configManager.getSiteUrl();
|
|
|
const body = prepareAttachmentTextForComment(comment);
|
|
|
|
|
|
const attachment = {
|
|
|
@@ -175,7 +172,7 @@ module.exports = function(crowi) {
|
|
|
|
|
|
const getSlackMessageTextForPage = function(path, user, updateType) {
|
|
|
let text;
|
|
|
- const url = config.crowi['app:siteUrl:fixed'] || '';
|
|
|
+ const url = crowi.configManager.getSiteUrl();
|
|
|
|
|
|
const pageUrl = `<${url}${path}|${path}>`;
|
|
|
if (updateType == 'create') {
|
|
|
@@ -189,7 +186,7 @@ module.exports = function(crowi) {
|
|
|
};
|
|
|
|
|
|
const getSlackMessageTextForComment = function(path, user) {
|
|
|
- const url = config.crowi['app:siteUrl:fixed'] || '';
|
|
|
+ const url = crowi.configManager.getSiteUrl();
|
|
|
const pageUrl = `<${url}${path}|${path}>`;
|
|
|
const text = `:speech_balloon: ${user.username} commented on ${pageUrl}`;
|
|
|
|