Feature: complete message inbox, view, and topbar integration

Added users_messages schema with correct field naming (senderId, recipientId)

Implemented message count and recent message fetch via storage.GetMessageCount and GetRecentMessages

Fixed field mismatches in SQL queries (recipientId vs recipient_id)

Displayed unread message badge in topbar with truncation for body preview

Linked messages in dropdown to full view (/account/messages/read?id=...)

Added fallback handling for unauthorized/invalid message access

Cleaned up BuildTemplateData to support full message context

Ensured CSRF/session/user context remains intact throughout
This commit is contained in:
2025-04-02 13:41:51 +01:00
parent b630296b8c
commit 2fd053777d
4 changed files with 110 additions and 118 deletions

View File

@@ -119,7 +119,6 @@ CREATE TABLE IF NOT EXISTS users_messages (
subject TEXT NOT NULL,
message TEXT,
is_read BOOLEAN DEFAULT FALSE,
type VARCHAR(50),
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP
);`