Compare commits
3 Commits
d641b01758
...
9d12e81e07
Author | SHA1 | Date | |
---|---|---|---|
|
9d12e81e07 | ||
|
af76e8f2f9 | ||
|
46ed3a1f41 |
@ -1,8 +1,8 @@
|
|||||||
import { RoomType } from "../mails/saveMessage";
|
import { RoomType } from "../../mails/message/saveMessage";
|
||||||
import { hasSameElements } from "../utils/array";
|
import { hasSameElements } from "../../utils/array";
|
||||||
import { transformEmojis } from "../utils/string";
|
import { transformEmojis } from "../../utils/string";
|
||||||
import { execQueryAsync, execQueryAsyncWithId, execQuery } from "./db";
|
import { execQueryAsync, execQueryAsyncWithId, execQuery } from "../db";
|
||||||
import { queryFromId, queryToId, queryCcId } from "./utils/addressQueries";
|
import { queryFromId, queryToId, queryCcId } from "../utils/addressQueries";
|
||||||
|
|
||||||
export async function getAllMembers(messageId: number) {
|
export async function getAllMembers(messageId: number) {
|
||||||
const query = `
|
const query = `
|
@ -1,17 +1,24 @@
|
|||||||
import { transformEmojis } from "../../utils/string";
|
import { transformEmojis } from "../../utils/string";
|
||||||
import { execQuery, execQueryAsync, execQueryAsyncWithId } from "../db";
|
import { execQuery, execQueryAsync, execQueryAsyncWithId } from "../db";
|
||||||
|
|
||||||
export async function registerMessage(timestamp, rfc822size, messageId) {
|
export async function registerMessage(timestamp: string, rfc822size: number, messageID: string) {
|
||||||
const query = `
|
const query = `
|
||||||
INSERT INTO message
|
INSERT INTO message
|
||||||
(idate, messageID, rfc822size) VALUES (?, ?, ?)
|
(idate, messageID, rfc822size) VALUES (?, ?, ?)
|
||||||
ON DUPLICATE KEY UPDATE message_id = LAST_INSERT_ID(message_id)
|
ON DUPLICATE KEY UPDATE message_id = LAST_INSERT_ID(message_id)
|
||||||
`;
|
`;
|
||||||
const values = [timestamp, messageId, rfc822size];
|
const values = [timestamp, messageID, rfc822size];
|
||||||
return await execQueryAsyncWithId(query, values);
|
return await execQueryAsyncWithId(query, values);
|
||||||
}
|
}
|
||||||
|
|
||||||
export function registerMailbox_message(mailboxId, uid, messageId, modseq, seen, deleted) {
|
export function registerMailbox_message(
|
||||||
|
mailboxId: number,
|
||||||
|
uid: number,
|
||||||
|
messageId: number,
|
||||||
|
modseq: number,
|
||||||
|
seen: boolean,
|
||||||
|
deleted: boolean,
|
||||||
|
) {
|
||||||
const query = `
|
const query = `
|
||||||
INSERT IGNORE INTO mailbox_message
|
INSERT IGNORE INTO mailbox_message
|
||||||
(mailbox_id, uid, message_id, modseq, seen, deleted) VALUES (?, ?, ?, ?, ?, ?)
|
(mailbox_id, uid, message_id, modseq, seen, deleted) VALUES (?, ?, ?, ?, ?, ?)
|
||||||
@ -20,7 +27,13 @@ export function registerMailbox_message(mailboxId, uid, messageId, modseq, seen,
|
|||||||
execQuery(query, values);
|
execQuery(query, values);
|
||||||
}
|
}
|
||||||
|
|
||||||
export function registerBodypart(messageId, part, bodypartId, bytes, nbLines) {
|
export function registerFlag(messageId: number, flagId: number) {
|
||||||
|
const query = `INSERT IGNORE INTO flag_name (message_id, flag_id) VALUES (?, ?)`;
|
||||||
|
const values = [messageId, flagId];
|
||||||
|
execQuery(query, values);
|
||||||
|
}
|
||||||
|
|
||||||
|
export function registerBodypart(messageId: number, part: string, bodypartId: number, bytes: number, nbLines: null) {
|
||||||
const query = `
|
const query = `
|
||||||
INSERT IGNORE INTO part_number
|
INSERT IGNORE INTO part_number
|
||||||
(message_id, part, bodypart_id, bytes, nb_lines) VALUES (?, ?, ?, ?, ?)
|
(message_id, part, bodypart_id, bytes, nb_lines) VALUES (?, ?, ?, ?, ?)
|
||||||
@ -36,7 +49,13 @@ export async function saveBodypart(bytes, hash, text, data) {
|
|||||||
return await execQueryAsyncWithId(query, values);
|
return await execQueryAsyncWithId(query, values);
|
||||||
}
|
}
|
||||||
|
|
||||||
export async function saveHeader_fields(messageId, fieldId, bodypartId, part, value) {
|
export async function saveHeader_fields(
|
||||||
|
messageId: number,
|
||||||
|
fieldId: number,
|
||||||
|
bodypartId: number,
|
||||||
|
part: string,
|
||||||
|
value: string,
|
||||||
|
) {
|
||||||
value = transformEmojis(value);
|
value = transformEmojis(value);
|
||||||
const query = `
|
const query = `
|
||||||
INSERT IGNORE INTO header_field
|
INSERT IGNORE INTO header_field
|
||||||
@ -46,7 +65,7 @@ export async function saveHeader_fields(messageId, fieldId, bodypartId, part, va
|
|||||||
return await execQueryAsync(query, values);
|
return await execQueryAsync(query, values);
|
||||||
}
|
}
|
||||||
|
|
||||||
export async function saveAddress_fields(messageId, fieldId, addressId, number) {
|
export async function saveAddress_fields(messageId: number, fieldId: number, addressId: number, number: number) {
|
||||||
const query = `
|
const query = `
|
||||||
INSERT IGNORE INTO address_field
|
INSERT IGNORE INTO address_field
|
||||||
(message_id , field_id, address_id, number) VALUES (?, ?, ?, ?)
|
(message_id , field_id, address_id, number) VALUES (?, ?, ?, ?)
|
||||||
@ -55,7 +74,7 @@ export async function saveAddress_fields(messageId, fieldId, addressId, number)
|
|||||||
return await execQueryAsync(query, values);
|
return await execQueryAsync(query, values);
|
||||||
}
|
}
|
||||||
|
|
||||||
export function saveSource(messageId, content) {
|
export function saveSource(messageId: number, content: string) {
|
||||||
content = transformEmojis(content);
|
content = transformEmojis(content);
|
||||||
const query = `
|
const query = `
|
||||||
INSERT INTO source (message_id, content) VALUES (?, ?)
|
INSERT INTO source (message_id, content) VALUES (?, ?)
|
||||||
@ -63,4 +82,4 @@ export function saveSource(messageId, content) {
|
|||||||
`;
|
`;
|
||||||
const values = [messageId, content, content];
|
const values = [messageId, content, content];
|
||||||
execQuery(query, values);
|
execQuery(query, values);
|
||||||
}
|
}
|
30
back/db/message/updateMessage-db.ts
Normal file
30
back/db/message/updateMessage-db.ts
Normal file
@ -0,0 +1,30 @@
|
|||||||
|
import { execQuery, execQueryAsync, execQueryAsyncWithId } from "../db";
|
||||||
|
|
||||||
|
export async function getFlags(uid: number): Promise<{flag_id: number, flag_name: string}[]> {
|
||||||
|
const query = `
|
||||||
|
SELECT * FROM flag_name
|
||||||
|
INNER JOIN flag ON flag.flag_id = flag_name.flag_id
|
||||||
|
INNER JOIN mailbox_message ON mailbox_message.message_id = flag.message_id
|
||||||
|
WHERE mailbox_message.uid = ?
|
||||||
|
`;
|
||||||
|
const values = [uid];
|
||||||
|
return await execQueryAsync(query, values);
|
||||||
|
}
|
||||||
|
|
||||||
|
export async function deleteFlag(messageId: number, flagId: number) {
|
||||||
|
const query = `DELETE FROM flag WHERE message_id = ? AND flag_id = ?`;
|
||||||
|
const values = [messageId, flagId];
|
||||||
|
execQuery(query, values);
|
||||||
|
}
|
||||||
|
|
||||||
|
export async function updateMailboxSeen(messageId: number, isSeen: boolean) {
|
||||||
|
const query = `UPDATE mailbox_message SET seen = ? WHERE message_id = ?`;
|
||||||
|
const values = [messageId, isSeen];
|
||||||
|
return await execQueryAsync(query, values);
|
||||||
|
}
|
||||||
|
|
||||||
|
export async function updateMailboxDeleted(messageId: number, isDeleted: boolean) {
|
||||||
|
const query = `UPDATE mailbox_message SET deleted = ? WHERE message_id = ?`;
|
||||||
|
const values = [messageId, isDeleted];
|
||||||
|
return await execQueryAsync(query, values);
|
||||||
|
}
|
@ -155,9 +155,27 @@ CREATE TABLE app_room_message (
|
|||||||
-- 14
|
-- 14
|
||||||
-- todo needed ?
|
-- todo needed ?
|
||||||
CREATE TABLE app_room_member (
|
CREATE TABLE app_room_member (
|
||||||
room_id INT NOT NULL,
|
room_id INT NOT NULL,
|
||||||
member_id INT NOT NULL,
|
member_id INT NOT NULL,
|
||||||
UNIQUE KEY (room_id, member_id),
|
UNIQUE KEY (room_id, member_id),
|
||||||
FOREIGN KEY (room_id) REFERENCES app_room(room_id) ON DELETE CASCADE,
|
FOREIGN KEY (room_id) REFERENCES app_room(room_id) ON DELETE CASCADE,
|
||||||
FOREIGN KEY (member_id) REFERENCES address(address_id)
|
FOREIGN KEY (member_id) REFERENCES address(address_id)
|
||||||
);
|
);
|
||||||
|
|
||||||
|
-- 15
|
||||||
|
create table flag_name (
|
||||||
|
flag_id INT NOT NULL,
|
||||||
|
flag_name VARCHAR(255) NOT NULL,
|
||||||
|
PRIMARY KEY (flag_id),
|
||||||
|
UNIQUE KEY (flag_name)
|
||||||
|
);
|
||||||
|
|
||||||
|
-- 16
|
||||||
|
create table flag (
|
||||||
|
message_id INT NOT NULL,
|
||||||
|
flag_id INT NOT NULL,
|
||||||
|
UNIQUE KEY (message_id, flag_id),
|
||||||
|
FOREIGN KEY (message_id) REFERENCES message(message_id) ON DELETE CASCADE,
|
||||||
|
FOREIGN KEY (message_id) REFERENCES message(message_id) ON DELETE CASCADE,
|
||||||
|
FOREIGN KEY (flag_id) REFERENCES flag_name(flag_id) ON DELETE CASCADE
|
||||||
|
);
|
@ -16,6 +16,18 @@ export async function getFieldId(field: string): Promise<number> {
|
|||||||
return await execQueryAsyncWithId(query, values);
|
return await execQueryAsyncWithId(query, values);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export async function getFlagId(flag: string): Promise<number> {
|
||||||
|
const query = `INSERT INTO flag_name (flag_name) VALUES (?) ON DUPLICATE KEY UPDATE flag_id=LAST_INSERT_ID(flag_id)`;
|
||||||
|
const values = [flag];
|
||||||
|
return await execQueryAsyncWithId(query, values);
|
||||||
|
}
|
||||||
|
|
||||||
|
export async function getMessageIdOnUid(uid: number): Promise<{message_id: number}[]> {
|
||||||
|
const query = `SELECT message_id FROM mailbox_message WHERE uid = ?`;
|
||||||
|
const values = [uid];
|
||||||
|
return await execQueryAsync(query, values);
|
||||||
|
}
|
||||||
|
|
||||||
export async function findRoomByOwner(ownerId: number): Promise<{ room_id: number }[]> {
|
export async function findRoomByOwner(ownerId: number): Promise<{ room_id: number }[]> {
|
||||||
const query = `SELECT room_id FROM app_room WHERE owner_id = ?`;
|
const query = `SELECT room_id FROM app_room WHERE owner_id = ?`;
|
||||||
const values = [ownerId];
|
const values = [ownerId];
|
||||||
|
@ -2,8 +2,15 @@ import Imap, { ImapMessageAttributes, Box } from "imap";
|
|||||||
import { getMailbox, updateMailbox } from "../../db/imap/imap-db";
|
import { getMailbox, updateMailbox } from "../../db/imap/imap-db";
|
||||||
import { Attrs, AttrsWithEnvelope } from "../../interfaces/mail/attrs.interface";
|
import { Attrs, AttrsWithEnvelope } from "../../interfaces/mail/attrs.interface";
|
||||||
import logger from "../../system/Logger";
|
import logger from "../../system/Logger";
|
||||||
import RegisterMessageInApp from "../saveMessage";
|
import RegisterMessageInApp from "../message/saveMessage";
|
||||||
import { saveMessage } from "../storeMessage";
|
import { saveMessage } from "../message/storeMessage";
|
||||||
|
import updateMessage from "../message/updateMessage";
|
||||||
|
|
||||||
|
export interface ImapInfo {
|
||||||
|
uid: number;
|
||||||
|
modseq: string;
|
||||||
|
flags: string[];
|
||||||
|
}
|
||||||
|
|
||||||
export default class Mailbox {
|
export default class Mailbox {
|
||||||
imap: Imap;
|
imap: Imap;
|
||||||
@ -38,6 +45,7 @@ export default class Mailbox {
|
|||||||
logger.log("Already up to date")
|
logger.log("Already up to date")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// wait for new mails
|
||||||
this.imap.on("mail", (numNewMsgs: number) => {
|
this.imap.on("mail", (numNewMsgs: number) => {
|
||||||
if (!this.syncing) {
|
if (!this.syncing) {
|
||||||
// if not syncing restart a sync
|
// if not syncing restart a sync
|
||||||
@ -47,6 +55,11 @@ export default class Mailbox {
|
|||||||
this.msgToSync += numNewMsgs;
|
this.msgToSync += numNewMsgs;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
this.imap.on("update", (seqno: number, info: ImapInfo) => {
|
||||||
|
const updateMsg = new updateMessage(info.uid, info.flags);
|
||||||
|
updateMsg.updateFlags();
|
||||||
|
});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -10,12 +10,12 @@ import {
|
|||||||
getThreadInfo,
|
getThreadInfo,
|
||||||
incrementNotSeenRoom,
|
incrementNotSeenRoom,
|
||||||
getThreadInfoOnId,
|
getThreadInfoOnId,
|
||||||
} from "../db/saveMessage-db";
|
} from "../../db/message/saveMessage-db";
|
||||||
|
|
||||||
import { findRoomByOwner, getAddresseId, getUserIdOfMailbox } from "../db/utils/mail";
|
import { findRoomByOwner, getAddresseId, getUserIdOfMailbox } from "../../db/utils/mail";
|
||||||
import { nbMembers } from "./utils/envelopeUtils";
|
import { nbMembers } from "../utils/envelopeUtils";
|
||||||
import logger from "../system/Logger";
|
import logger from "../../system/Logger";
|
||||||
import { Attrs, Envelope, User } from "../interfaces/mail/attrs.interface";
|
import { Attrs, Envelope, User } from "../../interfaces/mail/attrs.interface";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* take object address and join mailbox and host to return mailbox@host
|
* take object address and join mailbox and host to return mailbox@host
|
||||||
@ -50,7 +50,7 @@ export default class RegisterMessageInApp {
|
|||||||
this.envelope = this.attrs.envelope;
|
this.envelope = this.attrs.envelope;
|
||||||
this.messageID = this.envelope?.messageId;
|
this.messageID = this.envelope?.messageId;
|
||||||
this.boxId = _boxId;
|
this.boxId = _boxId;
|
||||||
this.isSeen = this.attrs.flags.includes("\\Seen") ? true : false;
|
this.isSeen = this.attrs.flags.includes("\\Seen");
|
||||||
this.ownerId = -1;
|
this.ownerId = -1;
|
||||||
this.userId = -1;
|
this.userId = -1;
|
||||||
this.inReplyTo = "";
|
this.inReplyTo = "";
|
@ -1,5 +1,5 @@
|
|||||||
import { getAddresseId } from "../db/utils/mail";
|
import { getAddresseId, getFlagId } from "../../db/utils/mail";
|
||||||
import {simpleParser} from "mailparser";
|
import { EmailAddress, ParsedMail, simpleParser } from "mailparser";
|
||||||
import moment from "moment";
|
import moment from "moment";
|
||||||
import Imap from "imap";
|
import Imap from "imap";
|
||||||
import {
|
import {
|
||||||
@ -10,11 +10,12 @@ import {
|
|||||||
registerBodypart,
|
registerBodypart,
|
||||||
saveBodypart,
|
saveBodypart,
|
||||||
saveSource,
|
saveSource,
|
||||||
} from "../db/imap/storeMessage-db";
|
registerFlag,
|
||||||
|
} from "../../db/message/storeMessage-db";
|
||||||
|
|
||||||
import { getFieldId } from "../db/utils/mail";
|
import { getFieldId } from "../../db/utils/mail";
|
||||||
import logger from "../system/Logger";
|
import logger from "../../system/Logger";
|
||||||
import { AttrsWithEnvelope } from "../interfaces/mail/attrs.interface";
|
import { AttrsWithEnvelope } from "../../interfaces/mail/attrs.interface";
|
||||||
|
|
||||||
export function saveMessage(attrs: AttrsWithEnvelope, mailboxId: number, imap: Imap): Promise<number> {
|
export function saveMessage(attrs: AttrsWithEnvelope, mailboxId: number, imap: Imap): Promise<number> {
|
||||||
const envelope = attrs.envelope;
|
const envelope = attrs.envelope;
|
||||||
@ -25,10 +26,13 @@ export function saveMessage(attrs: AttrsWithEnvelope, mailboxId: number, imap: I
|
|||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
registerMessage(ts, rfc822size, messageID)
|
registerMessage(ts, rfc822size, messageID)
|
||||||
.then((messageId) => {
|
.then((messageId) => {
|
||||||
const isSeen = attrs.flags.includes("\\Seen") ? 1 : 0; // todo verify
|
const isSeen: boolean = attrs.flags.includes("\\Seen");
|
||||||
const deleted = attrs.flags.includes("\\Deleted") ? 1 : 0; // todo verify
|
const deleted: boolean = attrs.flags.includes("\\Deleted");
|
||||||
|
|
||||||
registerMailbox_message(mailboxId, attrs.uid, messageId, attrs?.modseq, isSeen, deleted);
|
registerMailbox_message(mailboxId, attrs.uid, messageId, attrs?.modseq || 0, isSeen, deleted);
|
||||||
|
registerFlags(messageId, attrs.flags);
|
||||||
|
|
||||||
|
// fetch message to save everything
|
||||||
const f = imap.fetch(attrs.uid, { bodies: "" });
|
const f = imap.fetch(attrs.uid, { bodies: "" });
|
||||||
let buffer = "";
|
let buffer = "";
|
||||||
|
|
||||||
@ -69,14 +73,24 @@ export function saveMessage(attrs: AttrsWithEnvelope, mailboxId: number, imap: I
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
async function saveFromParsedData(parsed, messageId) {
|
function registerFlags(messageId: number, flags: string[]) {
|
||||||
|
flags.forEach((flag) => {
|
||||||
|
getFlagId(flag).then((flagId) => {
|
||||||
|
registerFlag(messageId, flagId);
|
||||||
|
}).catch((err: Error) => {
|
||||||
|
logger.err(err);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
async function saveFromParsedData(parsed: ParsedMail, messageId: number) {
|
||||||
const promises: Promise<any>[] = [];
|
const promises: Promise<any>[] = [];
|
||||||
Object.keys(parsed).forEach((key) => {
|
Object.keys(parsed).forEach((key) => {
|
||||||
if (["from", "to", "cc", "bcc", "replyTo"].includes(key)) {
|
if (["from", "to", "cc", "bcc", "replyTo"].includes(key)) {
|
||||||
promises.push(
|
promises.push(
|
||||||
// save address field
|
// save address field
|
||||||
getFieldId(key).then((fieldId) => {
|
getFieldId(key).then((fieldId) => {
|
||||||
parsed[key].value.forEach((addr, nb) => {
|
parsed[key].value.forEach((addr: EmailAddress, nb: number) => {
|
||||||
getAddresseId(addr.address, addr.name).then(async (addressId) => {
|
getAddresseId(addr.address, addr.name).then(async (addressId) => {
|
||||||
await saveAddress_fields(messageId, fieldId, addressId, nb);
|
await saveAddress_fields(messageId, fieldId, addressId, nb);
|
||||||
});
|
});
|
||||||
@ -120,7 +134,6 @@ async function saveFromParsedData(parsed, messageId) {
|
|||||||
// todo when transfered
|
// todo when transfered
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if (process.env["NODE_DEV"] == "TEST") {
|
if (process.env["NODE_DEV"] == "TEST") {
|
||||||
module.exports = {
|
module.exports = {
|
||||||
saveFromParsedData,
|
saveFromParsedData,
|
43
back/mails/message/updateMessage.ts
Normal file
43
back/mails/message/updateMessage.ts
Normal file
@ -0,0 +1,43 @@
|
|||||||
|
import { registerFlag } from "../../db/message/storeMessage-db";
|
||||||
|
import { deleteFlag, getFlags, updateMailboxDeleted, updateMailboxSeen } from "../../db/message/updateMessage-db";
|
||||||
|
import { getFlagId, getMessageIdOnUid } from "../../db/utils/mail";
|
||||||
|
|
||||||
|
export default class updateMessage {
|
||||||
|
uid: number;
|
||||||
|
flags: string[];
|
||||||
|
|
||||||
|
constructor(_uid: number, _flags: string[]) {
|
||||||
|
this.uid = _uid;
|
||||||
|
this.flags = _flags;
|
||||||
|
}
|
||||||
|
|
||||||
|
async updateFlags() {
|
||||||
|
const messageId = (await getMessageIdOnUid(this.uid))[0].message_id;
|
||||||
|
const currentFlags = await getFlags(this.uid);
|
||||||
|
|
||||||
|
const flagsToAdd = this.flags.filter((flag) => !currentFlags.find((f) => flag == f.flag_name));
|
||||||
|
const flagToRm = currentFlags.filter((f) => !this.flags.includes(f.flag_name));
|
||||||
|
|
||||||
|
flagsToAdd.forEach(async (flag) => {
|
||||||
|
const flagId = await getFlagId(flag);
|
||||||
|
registerFlag(messageId, flagId);
|
||||||
|
});
|
||||||
|
|
||||||
|
flagToRm.forEach(async (flag) => {
|
||||||
|
deleteFlag(messageId, flag.flag_id);
|
||||||
|
});
|
||||||
|
|
||||||
|
// todo update seen counter rooms
|
||||||
|
if (flagsToAdd.includes("\\Seen")) {
|
||||||
|
updateMailboxSeen(messageId, true);
|
||||||
|
} else if (flagToRm.find((f) => f.flag_name == "\\Seen")) {
|
||||||
|
updateMailboxSeen(messageId, false);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (flagsToAdd.includes("\\Deleted")) {
|
||||||
|
updateMailboxDeleted(messageId, true);
|
||||||
|
} else if (flagToRm.find((f) => f.flag_name == "\\Deleted")) {
|
||||||
|
updateMailboxDeleted(messageId, false);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -10,7 +10,7 @@ import { generateAttrs, generateUsers, randomInt } from "../test-utils/test-attr
|
|||||||
import { jest, describe, it, expect } from "@jest/globals";
|
import { jest, describe, it, expect } from "@jest/globals";
|
||||||
import { mocked } from "jest-mock";
|
import { mocked } from "jest-mock";
|
||||||
|
|
||||||
import registerMessageInApp, { RoomType } from "../../mails/saveMessage";
|
import registerMessageInApp, { RoomType } from "../../mails/message/saveMessage";
|
||||||
|
|
||||||
const db = new saveMessageDatabase(generateUsers(5));
|
const db = new saveMessageDatabase(generateUsers(5));
|
||||||
const ownUser = db.users[0];
|
const ownUser = db.users[0];
|
||||||
@ -52,7 +52,7 @@ import {
|
|||||||
getThreadInfo,
|
getThreadInfo,
|
||||||
getThreadInfoOnId,
|
getThreadInfoOnId,
|
||||||
incrementNotSeenRoom,
|
incrementNotSeenRoom,
|
||||||
} from "../../db/saveMessage-db";
|
} from "../../db/message/saveMessage-db";
|
||||||
import { AttrsWithEnvelopeTest, createReplyWithSameMembers } from "../test-utils/test-messageUtils";
|
import { AttrsWithEnvelopeTest, createReplyWithSameMembers } from "../test-utils/test-messageUtils";
|
||||||
// todo esbuild
|
// todo esbuild
|
||||||
// new message from us
|
// new message from us
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
import { AttrsWithEnvelope, User } from "../../../interfaces/mail/attrs.interface";
|
import { AttrsWithEnvelope, User } from "../../../interfaces/mail/attrs.interface";
|
||||||
import { RoomType } from "../../../mails/saveMessage";
|
import { RoomType } from "../../../mails/message/saveMessage";
|
||||||
import { getMembers } from "../../../mails/utils/envelopeUtils";
|
import { getMembers } from "../../../mails/utils/envelopeUtils";
|
||||||
import { hasSameElements } from "../../../utils/array";
|
import { hasSameElements } from "../../../utils/array";
|
||||||
import { generateUsers, UserTest } from "../test-attrsUtils";
|
import { generateUsers, UserTest } from "../test-attrsUtils";
|
||||||
|
Loading…
Reference in New Issue
Block a user