Include timestamp & edited at in chatroom responses

This commit is contained in:
2026-02-01 22:11:01 -07:00
parent a73834a849
commit e7ce9e7fed
3 changed files with 21 additions and 9 deletions

View File

@@ -3,7 +3,7 @@
-- https://www.phpmyadmin.net/ -- https://www.phpmyadmin.net/
-- --
-- Host: localhost -- Host: localhost
-- Generation Time: Jan 31, 2026 at 08:57 PM -- Generation Time: Feb 02, 2026 at 05:08 AM
-- Server version: 12.1.2-MariaDB -- Server version: 12.1.2-MariaDB
-- PHP Version: 8.5.2 -- PHP Version: 8.5.2
@@ -46,7 +46,8 @@ CREATE TABLE `chats` (
`userId` bigint(20) NOT NULL, `userId` bigint(20) NOT NULL,
`content` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL, `content` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL,
`timestamp` bigint(20) NOT NULL, `timestamp` bigint(20) NOT NULL,
`deleted_at` bigint(20) NOT NULL DEFAULT 0 `deleted_at` bigint(20) NOT NULL DEFAULT 0,
`edited_at` bigint(20) NOT NULL DEFAULT 0
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci ROW_FORMAT=COMPRESSED; ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci ROW_FORMAT=COMPRESSED;
-- -------------------------------------------------------- -- --------------------------------------------------------
@@ -78,7 +79,7 @@ CREATE TABLE `splashtexts` (
`userId` bigint(20) NOT NULL, `userId` bigint(20) NOT NULL,
`content` varchar(72) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL, `content` varchar(72) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL,
`timestamp` bigint(20) NOT NULL, `timestamp` bigint(20) NOT NULL,
`state` tinyint(1) NOT NULL DEFAULT 0 `state` tinyint(1) NOT NULL DEFAULT 1
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci ROW_FORMAT=COMPRESSED; ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci ROW_FORMAT=COMPRESSED;
-- -------------------------------------------------------- -- --------------------------------------------------------

View File

@@ -202,7 +202,9 @@ app.ws('/ws', {
.select({ .select({
id: berryDashChats.id, id: berryDashChats.id,
content: berryDashChats.content, content: berryDashChats.content,
userId: berryDashChats.userId userId: berryDashChats.userId,
timestamp: berryDashChats.timestamp,
editedAt: berryDashChats.editedAt
}) })
.from(berryDashChats) .from(berryDashChats)
.limit(50) .limit(50)
@@ -274,7 +276,9 @@ app.ws('/ws', {
overlayColor: savedata?.settings?.colors?.overlay ?? [ overlayColor: savedata?.settings?.colors?.overlay ?? [
255, 255, 255 255, 255, 255
], ],
customIcon: savedata?.bird?.customIcon?.selected ?? null customIcon: savedata?.bird?.customIcon?.selected ?? null,
timestamp: chat.timestamp,
editedAt: chat.editedAt
} }
} }
}) })
@@ -363,7 +367,9 @@ app.ws('/ws', {
overlayColor: savedata?.settings?.colors?.overlay ?? [ overlayColor: savedata?.settings?.colors?.overlay ?? [
255, 255, 255 255, 255, 255
], ],
customIcon: savedata?.bird?.customIcon?.selected ?? null customIcon: savedata?.bird?.customIcon?.selected ?? null,
timestamp: time,
editedAt: 0
} }
}) })
) )
@@ -393,7 +399,9 @@ app.ws('/ws', {
.select({ .select({
id: berryDashChats.id, id: berryDashChats.id,
content: berryDashChats.content, content: berryDashChats.content,
userId: berryDashChats.userId userId: berryDashChats.userId,
timestamp: berryDashChats.timestamp,
editedAt: berryDashChats.editedAt
}) })
.from(berryDashChats) .from(berryDashChats)
.limit(50) .limit(50)
@@ -434,7 +442,9 @@ app.ws('/ws', {
overlayColor: savedata?.settings?.colors?.overlay ?? [ overlayColor: savedata?.settings?.colors?.overlay ?? [
255, 255, 255 255, 255, 255
], ],
customIcon: savedata?.bird?.customIcon?.selected ?? null customIcon: savedata?.bird?.customIcon?.selected ?? null,
timestamp: chat.timestamp,
editedAt: chat.editedAt
}) })
} }

View File

@@ -115,7 +115,8 @@ export const berryDashChats = mysqlTable('chats', {
userId: bigint('userId', { mode: 'number' }).notNull(), userId: bigint('userId', { mode: 'number' }).notNull(),
content: longtext('content').notNull(), content: longtext('content').notNull(),
timestamp: bigint('timestamp', { mode: 'number' }).notNull(), timestamp: bigint('timestamp', { mode: 'number' }).notNull(),
deletedAt: bigint('deleted_at', { mode: 'number' }).default(0).notNull() deletedAt: bigint('deleted_at', { mode: 'number' }).default(0).notNull(),
editedAt: bigint('edited_at', { mode: 'number' }).default(0).notNull()
}) })
export const berryDashChatroomReports = mysqlTable('chatroom_reports', { export const berryDashChatroomReports = mysqlTable('chatroom_reports', {