mirror of
https://github.com/Moepchi/webspeak3.git
synced 2026-12-02 17:32:50 +08:00
Add offline messages (Offline Nachrichten) dialog
Wires up raw TS3 protocol commands for offline messages, since tsclientlib's generated code has no typed builder for them (same situation as banlist/complainlist in the previous feature): - Connector: messagelist, messageget, messageadd, messagedel, messageupdateflag as raw OutCommand invocations. Replies parsed via the existing StreamItem::MessageEvent pending-flag pattern, reusing InMessage::OfflineMessageList (list, no body) and InMessage::OfflineMessage (single message with full body, response to messageget). - Gateway: typed events/methods threading the new commands from WebSocket clients through to the connector's stdin protocol. - Frontend: new "Offline Nachrichten" dialog in the Extras menu with a message list (subject/from/timestamp, unread dot), a detail view (full body + mark-as-read), delete, and a compose form to send a new message to a target client UID. Demo mode gets one scripted message. Verified against the real test server (192.168.178.108): messagelist returns a clean DatabaseEmptyResult error for an account with no messages (falls back to the dialog's existing 6s "unavailable" timeout, same as banlist/complainlist), and messageadd correctly surfaces a permissionError for a guest account lacking send rights - both proving the raw command round-trip works end to end. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
1 parent
bd0122812d
commit
dbe9a3c2df
7 files changed
+552
-1
No files matched your search
@@ -275,6 +275,42 @@ export class DemoSocket {
|
||||
case "deleteComplaint":
|
||||
case "deleteAllComplaintsFor":
|
||||
break;
|
||||
case "getOfflineMessageList": {
|
||||
this.after(400, () =>
|
||||
this.emit({
|
||||
type: "offlineMessageList",
|
||||
entries: [
|
||||
{
|
||||
messageId: 1,
|
||||
clientUid: "demo-uid-sam",
|
||||
subject: "Missed you online",
|
||||
timestamp: "2026-08-03 20:11:44",
|
||||
isRead: false,
|
||||
},
|
||||
],
|
||||
})
|
||||
);
|
||||
break;
|
||||
}
|
||||
case "getOfflineMessage": {
|
||||
this.after(300, () =>
|
||||
this.emit({
|
||||
type: "offlineMessage",
|
||||
messageId: msg.messageId,
|
||||
clientUid: "demo-uid-sam",
|
||||
subject: "Missed you online",
|
||||
message: "Hey, we were on last night in the Gaming channel - join us next time!",
|
||||
timestamp: "2026-08-03 20:11:44",
|
||||
})
|
||||
);
|
||||
break;
|
||||
}
|
||||
case "sendOfflineMessage":
|
||||
case "deleteOfflineMessage":
|
||||
case "markOfflineMessageRead":
|
||||
// No observable effect - the frontend already optimistically updates
|
||||
// its own state for delete/read, and there's no NPC to reply to a send.
|
||||
break;
|
||||
// "disconnect" is intentionally unhandled here: handleDisconnect() in
|
||||
// App.tsx always calls socket.close() right after sending it, and
|
||||
// close() already emits the "disconnected" event below.
|
||||
|
||||
Reference in new issue
Block a user