remove unseen in database
This commit is contained in:
@@ -51,12 +51,6 @@ export function updateLastUpdateRoom(roomId: number, idate: string) {
|
||||
execQuery(query, values);
|
||||
}
|
||||
|
||||
export async function incrementNotSeenRoom(roomId: number) {
|
||||
const query = `UPDATE app_room SET notSeen = notSeen + 1 WHERE room_id = ?`;
|
||||
const values = [roomId];
|
||||
execQuery(query, values);
|
||||
}
|
||||
|
||||
export async function getThreadInfo(messageID: string): Promise<{ room_id: number; root_id: number }[]> {
|
||||
const query = `
|
||||
SELECT
|
||||
|
||||
@@ -27,10 +27,10 @@ export function registerMailbox_message(
|
||||
execQuery(query, values);
|
||||
}
|
||||
|
||||
export function registerFlag(messageId: number, flagId: number) {
|
||||
const query = `INSERT IGNORE INTO flag_name (message_id, flag_id) VALUES (?, ?)`;
|
||||
export async function registerFlag(messageId: number, flagId: number) {
|
||||
const query = `INSERT IGNORE INTO flag (message_id, flag_id) VALUES (?, ?)`;
|
||||
const values = [messageId, flagId];
|
||||
execQuery(query, values);
|
||||
return await execQueryAsync(query, values);
|
||||
}
|
||||
|
||||
export function registerBodypart(messageId: number, part: string, bodypartId: number, bytes: number, nbLines: null) {
|
||||
|
||||
@@ -123,7 +123,6 @@ CREATE TABLE app_room (
|
||||
owner_id INT NOT NULL,
|
||||
message_id INT NOT NULL,
|
||||
room_type INT NOT NULL DEFAULT 0,
|
||||
notSeen INT NOT NULL DEFAULT 0,
|
||||
lastUpdate TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP(),
|
||||
PRIMARY KEY (room_id),
|
||||
UNIQUE KEY (owner_id, message_id, room_type),
|
||||
|
||||
Reference in New Issue
Block a user