openvibers/openvibe.live Commits

DM notifications link to /?dm=<conversation id>, which the messenger opens once someone is signed in (and drops from the address bar). They used to link to /dm/<id>, a page Live never had: it showed the home page and, since real 404s, Page not found. Links already sent redirect from /dm/<id>

OP OpenVibers committed 23 Sept 2026 · 62261ca84f · 4 files, +27 −2


Changes

ddiff --git a/public/js/messenger.js b/public/js/messenger.js
iindex eec4f228..01430399 100644
---- a/public/js/messenger.js
++++ b/public/js/messenger.js
@@@ -1193,6 +1193,27 @@
// Hook into chat WebSocket message handler
// The chat.js `handleChatMessage` will call `handleIncomingDm` for DM type messages
window._messengerHandleDm = handleIncomingDm;
++ openLinkedThread();
++ }
++
++ // DM notifications (Network push, the notification centre) link to /?dm=<conversation id>:
++ // open that thread once someone is signed in, and take the parameter out of the address bar.
++ function openLinkedThread() {
++ const params = new URLSearchParams(location.search);
++ if (!params.has('dm')) return;
++ const id = Number(params.get('dm'));
++ params.delete('dm');
++ const qs = params.toString();
++ history.replaceState(history.state, '', location.pathname + (qs ? `?${qs}` : '') + location.hash);
++ if (!Number.isSafeInteger(id) || id <= 0) return;
++ const open = () => { if (!panelOpen) togglePanel(); openThread(id); };
++ if (typeof currentUser !== 'undefined' && currentUser) return open();
++ const onAuth = (e) => {
++ if (!e.detail || !e.detail.user) return;
++ window.removeEventListener('openvibe-auth-changed', onAuth);
++ open();
++ };
++ window.addEventListener('openvibe-auth-changed', onAuth);
}
function resetMessengerStateForAuthChange(newUser) {
ddiff --git a/server/chat/dm-routes.js b/server/chat/dm-routes.js
iindex d258e19f..79f9c7aa 100644
---- a/server/chat/dm-routes.js
++++ b/server/chat/dm-routes.js
@@@ -217,7 +217,7 @@ router.post('/conversations/:id/messages', (req, res) => {
type: 'DIRECT_MESSAGE',
title: `Message from ${senderName}`,
message: preview,
-- url: `https://openvibe.live/dm/${convId}`,
++ url: `https://openvibe.live/?dm=${convId}`,
...actorInfo(sender),
});
}
ddiff --git a/server/chat/live-context-routes.js b/server/chat/live-context-routes.js
iindex f3f80cb1..dbb6d79c 100644
---- a/server/chat/live-context-routes.js
++++ b/server/chat/live-context-routes.js
@@@ -564,7 +564,7 @@ effectsRouter.post('/notify/dm', (req, res) => {
type: 'DIRECT_MESSAGE',
title: `Message from ${senderName}`,
message: 'Sent you a message',
-- url: `https://openvibe.live/dm/${convId}`,
++ url: `https://openvibe.live/?dm=${convId}`,
...actorInfo(sender),
});
}
ddiff --git a/server/index.js b/server/index.js
iindex 9cfd5bca..fde65872 100644
---- a/server/index.js
++++ b/server/index.js
@@@ -886,6 +886,10 @@ app.get('/media/:username', (req, res) => {
sendDocument(res, 'media-player.html');
});
++// DM notifications sent before 2026-09-23 linked to /dm/<conversation id>, a page Live never had;
++// the messenger opens the thread from /?dm=<id> now.
++app.get(/^\/dm\/(\d{1,12})\/?$/, (req, res) => res.redirect(302, `/?dm=${req.params[0]}`));
++
// ── Legal Pages ───────────────────────────────────────────────
app.get('/dmca', (req, res) => {
sendDocument(res, 'dmca.html');