mirror of
https://github.com/MarekWo/mc-webui.git
synced 2026-08-08 01:32:54 +02:00
fix(channels): include message id in /api/messages response
/api/messages was dropping channel_messages.id when building the response dict. The frontend therefore had msg.id=undefined for history-loaded rows, so createMessageElement's "typeof msg.id === 'number'" guard suppressed the raw-resend button, and refreshMessagesMeta couldn't find the wrappers either (data-msg-id only gets set when msg.id is truthy). End result: the raw-resend button only appeared on messages sent in the current session and was lost on every channel switch or page reload. Surfacing id costs nothing — the field already exists on the row — and also unblocks any future per-message UI that needs to address the row directly. createMessageElement already handles undefined id correctly for older clients, so this is a one-way frontend benefit. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
@@ -470,6 +470,7 @@ def get_messages():
|
||||
hop_count, path_hash_size, _ = decode_path_len(path_len_raw)
|
||||
|
||||
msg = {
|
||||
'id': row.get('id'),
|
||||
'sender': row.get('sender', ''),
|
||||
'content': row.get('content', ''),
|
||||
'timestamp': row.get('timestamp', 0),
|
||||
|
||||
Reference in New Issue
Block a user