Include timestamp & edited at in chatroom responses
This commit is contained in:
@@ -3,7 +3,7 @@
|
||||
-- https://www.phpmyadmin.net/
|
||||
--
|
||||
-- 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
|
||||
-- PHP Version: 8.5.2
|
||||
|
||||
@@ -46,7 +46,8 @@ CREATE TABLE `chats` (
|
||||
`userId` bigint(20) NOT NULL,
|
||||
`content` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin 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;
|
||||
|
||||
-- --------------------------------------------------------
|
||||
@@ -78,7 +79,7 @@ CREATE TABLE `splashtexts` (
|
||||
`userId` bigint(20) NOT NULL,
|
||||
`content` varchar(72) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin 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;
|
||||
|
||||
-- --------------------------------------------------------
|
||||
|
||||
20
src/index.ts
20
src/index.ts
@@ -202,7 +202,9 @@ app.ws('/ws', {
|
||||
.select({
|
||||
id: berryDashChats.id,
|
||||
content: berryDashChats.content,
|
||||
userId: berryDashChats.userId
|
||||
userId: berryDashChats.userId,
|
||||
timestamp: berryDashChats.timestamp,
|
||||
editedAt: berryDashChats.editedAt
|
||||
})
|
||||
.from(berryDashChats)
|
||||
.limit(50)
|
||||
@@ -274,7 +276,9 @@ app.ws('/ws', {
|
||||
overlayColor: savedata?.settings?.colors?.overlay ?? [
|
||||
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 ?? [
|
||||
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({
|
||||
id: berryDashChats.id,
|
||||
content: berryDashChats.content,
|
||||
userId: berryDashChats.userId
|
||||
userId: berryDashChats.userId,
|
||||
timestamp: berryDashChats.timestamp,
|
||||
editedAt: berryDashChats.editedAt
|
||||
})
|
||||
.from(berryDashChats)
|
||||
.limit(50)
|
||||
@@ -434,7 +442,9 @@ app.ws('/ws', {
|
||||
overlayColor: savedata?.settings?.colors?.overlay ?? [
|
||||
255, 255, 255
|
||||
],
|
||||
customIcon: savedata?.bird?.customIcon?.selected ?? null
|
||||
customIcon: savedata?.bird?.customIcon?.selected ?? null,
|
||||
timestamp: chat.timestamp,
|
||||
editedAt: chat.editedAt
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
@@ -115,7 +115,8 @@ export const berryDashChats = mysqlTable('chats', {
|
||||
userId: bigint('userId', { mode: 'number' }).notNull(),
|
||||
content: longtext('content').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', {
|
||||
|
||||
Reference in New Issue
Block a user