openvibers/openvibe.chat Commits

Room settings link an attached Community space at /forum (#376)

OP OpenVibers committed 7 days ago · b44fa341d2 · 3 files, +4 −4

Community's forum moved from /s to /forum (design 2026-11-07), so a room's
'Attached to' link follows it.

Changes

ddiff --git a/server/config.js b/server/config.js
iindex c2e27af..fa9d209 100644
---- a/server/config.js
++++ b/server/config.js
@@@ -87,7 +87,7 @@ module.exports = {
// openvibe.chat, the site (server/web/): global chat, messages and settings, served by Chat itself.
web: {
baseUrl: strip(process.env.CHAT_WEB_URL || (isProduction ? 'https://openvibe.chat' : 'http://localhost:4400')),
-- // Where a room's Community attachments link (a space is <communityUrl>/s/<slug>).
++ // Where a room's Community attachments link (a space is <communityUrl>/forum/<slug>).
communityUrl: strip(process.env.OV_COMMUNITY_URL || 'https://openvibe.community'),
},
// Pictures in rooms and channels (server/rooms/pictures.js): uploaded to OpenVibe.Pics as the person (their own
ddiff --git a/server/web/pages.js b/server/web/pages.js
iindex 326c668..e0b21da 100644
---- a/server/web/pages.js
++++ b/server/web/pages.js
@@@ -1010,7 +1010,7 @@ ${hookList.length < roomHooks.MAX_PER_ROOM ? `<form class="oc-form" method="post
<label>Each alert <select name="queue_kind"><option value="">posts a message</option><option value="research">posts and asks Vibe to look into it (research, runs on your allowance)</option><option value="code">posts and queues a code task for a worker</option><option value="other">posts and queues a task for a worker</option></select></label>
<p><button type="submit">Make a hook</button></p></form>` : ''}</details>` : '';
const communityUrl = config.web.communityUrl;
-- const attachList = can.manage ? `<section class="oc-set"><h2>Attached to</h2>${attachments.length ? `<ul class="oc-members">${attachments.map((a) => `<li><a href="${esc(a.service === 'community' ? `${communityUrl}/s/${encodeURIComponent(a.resource)}` : '#')}">${esc(a.title || a.resource)}</a> <span class="oc-muted">${esc(a.service === 'community' ? 'OpenVibe.Community space' : a.service)}</span><form class="oc-inline" method="post" action="/r/${esc(room.slug)}/attachments/${encodeURIComponent(a.service)}/${encodeURIComponent(a.resource)}/detach"><button type="submit" class="oc-link">Detach</button></form></li>`).join('')}</ul>` : '<p class="oc-muted oc-set-note">Not attached anywhere. A Community space you own can attach this room from the space\'s page.</p>'}</section>` : '';
++ const attachList = can.manage ? `<section class="oc-set"><h2>Attached to</h2>${attachments.length ? `<ul class="oc-members">${attachments.map((a) => `<li><a href="${esc(a.service === 'community' ? `${communityUrl}/forum/${encodeURIComponent(a.resource)}` : '#')}">${esc(a.title || a.resource)}</a> <span class="oc-muted">${esc(a.service === 'community' ? 'OpenVibe.Community space' : a.service)}</span><form class="oc-inline" method="post" action="/r/${esc(room.slug)}/attachments/${encodeURIComponent(a.service)}/${encodeURIComponent(a.resource)}/detach"><button type="submit" class="oc-link">Detach</button></form></li>`).join('')}</ul>` : '<p class="oc-muted oc-set-note">Not attached anywhere. A Community space you own can attach this room from the space\'s page.</p>'}</section>` : '';
await page(req, res, 200, {
actor, title: `${room.name}: settings`, path: `/r/${room.slug}/settings`, active: 'rooms', robots: 'noindex, nofollow', footer: 'compact', script: true, page: { view: 'settings' },
body: `${ui.head({ title: 'Room settings', sub: esc(room.name), back: { href: `/r/${room.slug}`, label: 'Back to the room' } })}${saved}${error}
ddiff --git a/test/room-kinds.test.js b/test/room-kinds.test.js
iindex 4080433..d7883a2 100644
---- a/test/room-kinds.test.js
++++ b/test/room-kinds.test.js
@@@ -311,9 +311,9 @@ t('the site: kinds on the rooms page, the call panel, roles and attachments in s
assert.match(r.text, /· seen <time/, 'moderators see when people were last here');
await api('POST', '/tea-talk/attachments', own, { service: 'community', resource: 'general', title: 'General <b>' });
r = await page('/r/tea-talk/settings', own);
-- assert.match(r.text, /<a href="https:\/\/openvibe\.community\/s\/general">General &lt;b&gt;<\/a>/);
++ assert.match(r.text, /<a href="https:\/\/openvibe\.community\/forum\/general">General &lt;b&gt;<\/a>/);
assert.match(r.text, /action="\/r\/tea-talk\/attachments\/community\/general\/detach"/);
-- assert.ok(!(await page('/r/tea-talk', own)).text.includes('openvibe.community/s/general'), 'the room page itself makes no claim about the space');
++ assert.ok(!(await page('/r/tea-talk', own)).text.includes('openvibe.community/forum/general'), 'the room page itself makes no claim about the space');
r = await page('/r/openvibe-news', out);
assert.match(r.text, /Announcements from OpenVibe staff/);