test unseen behavior
This commit is contained in:
@@ -73,19 +73,28 @@ export async function getThreadInfo(messageID: string): Promise<{ room_id: numbe
|
||||
return await execQueryAsync(query, values);
|
||||
}
|
||||
|
||||
export async function getThreadInfoOnId(threadId: number): Promise<{ room_id: number; root_id: number }[]> {
|
||||
const query = `
|
||||
SELECT
|
||||
app_room.room_id
|
||||
app_thread.root_id
|
||||
FROM app_room
|
||||
WHERE room_id = ?
|
||||
`;
|
||||
const values = [threadId];
|
||||
return await execQueryAsync(query, values);
|
||||
}
|
||||
|
||||
export async function registerThread(roomId: number, parentId: number, rootId: number) {
|
||||
const query = `INSERT IGNORE INTO app_thread (room_id, parent_id, root_id) VALUES (?, ?, ?)`;
|
||||
const values = [roomId, parentId, rootId];
|
||||
return await execQueryAsync(query, values);
|
||||
}
|
||||
|
||||
export async function isRoomGroup(roomId: number): Promise<boolean> {
|
||||
return new Promise((resolve, reject) => {
|
||||
const query = `SELECT isGroup FROM app_room WHERE room_id = ?`;
|
||||
const values = [roomId];
|
||||
const results = execQueryAsync(query, values);
|
||||
return results[0].isGroup;
|
||||
});
|
||||
export async function getRoomType(roomId: number): Promise<{ room_type: number }[]> {
|
||||
const query = `SELECT room_type FROM app_room WHERE room_id = ?`;
|
||||
const values = [roomId];
|
||||
return await execQueryAsync(query, values);
|
||||
}
|
||||
|
||||
export async function findRoomsFromMessage(messageID: string): Promise<{ room_id: number }[]> {
|
||||
|
||||
Reference in New Issue
Block a user