asdkjlfhlaskjdhf

This commit is contained in:
2026-03-11 01:20:31 -04:00
parent 2fea81d46b
commit 3160d96c15
5 changed files with 25 additions and 58 deletions

View File

@@ -1,50 +1,41 @@
// coms/client/public/data.js
// Data module: holds the inmemory threads, notices and reply state
import { notifyNotice } from "./notifications.js";
// Map of all messages and notices by ID (string IDs)
// Clients own session ID
// Clients own session ID.
let myId = null;
// Map of all messages and notices by ID (string IDs).
const threads = new Map();
// Map of connected users by unique ID
// Map of connected users by unique ID.
const users = new Map();
// Ordered list of rootlevel IDs (messages and notices, stored as strings)
// Ordered list of rootlevel IDs (messages and notices, stored as strings).
const rootIds = [];
// Negative counter to generate unique IDs for notices
// Negative counter to generate unique IDs for notices.
let noticeCounter = -1;
// ID of the message were currently replying to (string or null)
// ID of the message were currently replying to (string or null).
let replyTo = null;
// ID of the message currently focused for navigation (string or null)
// ID of the message currently focused for navigation (string or null).
let focusedId = null;
/**
* Set the focused message ID (or null to clear).
* @param {string|null} id
*/
// Set the focused message ID (or null to clear).
function setFocused(id) {
focusedId = id;
}
/**
* Get the currently focused message ID.
* @returns {string|null}
*/
// Get the currently focused message ID.
function getFocused() {
return focusedId;
}
/**
* Clear the current focus.
*/
function clearFocused() {
focusedId = null;
}
// -- User management API ---
// USER MANAGEMENT STUFF.
/**
* Register a user with their unique ID.