feat: port private messaging (私信) from upstream
- Add conversations/messages tables to schema.sql (upstream missed them) - API: GET/POST /api/conversations, GET/POST /api/conversations/[id]/messages, PUT /api/messages/[id]/read - Chat UI: conversation list modal, chat window with 3s polling, unread badge - Navbar message entry opens DM list; user profile has 发私信 button - Access control: only conversation participants (403 otherwise)
This commit is contained in:
1 parent
5ef8d4b1ff
commit
300ad5959c
11 files changed
+522
-3
No files matched your search
@@ -22,6 +22,13 @@ export default function Navbar({ onOpenModal }) {
|
||||
navigate(page);
|
||||
};
|
||||
|
||||
const openMessages = (e) => {
|
||||
e.preventDefault();
|
||||
setMenuOpen(false);
|
||||
// 打开私信列表(ChatManager 监听)
|
||||
window.dispatchEvent(new CustomEvent('forumlify-open-messages'));
|
||||
};
|
||||
|
||||
return (
|
||||
<nav id="navbar">
|
||||
<div className="nav-left">
|
||||
@@ -46,7 +53,7 @@ export default function Navbar({ onOpenModal }) {
|
||||
/>
|
||||
{menuOpen && (
|
||||
<div className="dropdown-menu show" onClick={(e) => e.stopPropagation()}>
|
||||
<a href="#" onClick={(e) => { e.preventDefault(); goPage('messages'); }}>
|
||||
<a href="#" onClick={openMessages}>
|
||||
<Icon name="message" /> 消息
|
||||
</a>
|
||||
<a href="#" onClick={(e) => { e.preventDefault(); goPage('settings'); }}>
|
||||
|
||||
Reference in new issue
Block a user