chatgui: channel sorting by name or last message time with preview

- Add last_msg_at column to channels table
- Update last_msg_at on every message insert (send/receive)
- Parameterize getChannels() with ChannelSortMode enum (Alphabetical/Recent)
- Add getChannelLastMessage() for preview text in channel list
- Add sorting combo to Profile settings page (stored in ui_state)
- Reload channels on message receive when sort is recent
This commit is contained in:
Evgeny committed 2026-07-26 11:08:59 +03:00
1 parent 332df381d1
commit 49da899964
10 files changed
+105 -12

No files matched your search

+1
View File
@@ -70,6 +70,7 @@ int topo_node_sqlite_init(sqlite3* db) {
" signature BLOB NOT NULL," // подпись при создании канал приватным ключом канала channel_id(NUL-terminated) || name(NUL-terminated) || owner_node_id(8 байт, LE uint64) || x25519_pubkey(32 байта) || ed25519_pubkey(32 байта)
" last_read_msg_id INTEGER," // для скроллинга чата
" last_pos_msg_id INTEGER," // для скроллинга чата
" last_msg_at INTEGER DEFAULT 0," // время последнего сообщения (unix timestamp)
" created_at INTEGER DEFAULT (unixepoch())" // когда создан
");";