|
@@ -1,7 +1,6 @@
|
|
const MessageModel = require('../model/message');
|
|
const MessageModel = require('../model/message');
|
|
const UserModel = require('../model/user');
|
|
const UserModel = require('../model/user');
|
|
const ChatModel = require('../model/chat');
|
|
const ChatModel = require('../model/chat');
|
|
-const Jimp = require('jimp');
|
|
|
|
const fs = require('fs').promises;
|
|
const fs = require('fs').promises;
|
|
const path = require('path');
|
|
const path = require('path');
|
|
const createFolderIsExist = require('../helpers/create-directory');
|
|
const createFolderIsExist = require('../helpers/create-directory');
|
|
@@ -256,8 +255,6 @@ const audioMessage = async (req, res, next) => {
|
|
const idTime = Math.round(Date.now() / 1000);
|
|
const idTime = Math.round(Date.now() / 1000);
|
|
const isChat = await ChatModel.getByField(id, userId);
|
|
const isChat = await ChatModel.getByField(id, userId);
|
|
const isCompanionChat = await ChatModel.getByField(userId, id);
|
|
const isCompanionChat = await ChatModel.getByField(userId, id);
|
|
- const DIR_AUDIOS = process.env.DIR_AUDIOS;
|
|
|
|
- const DIR_UPLOAD = process.env.DIR_UPLOAD;
|
|
|
|
const originalName = req.file.originalname;
|
|
const originalName = req.file.originalname;
|
|
const newNameAudio = `${Math.round(Date.now() / 1000)}${originalName}`;
|
|
const newNameAudio = `${Math.round(Date.now() / 1000)}${originalName}`;
|
|
const fullType = req.file.mimetype;
|
|
const fullType = req.file.mimetype;
|
|
@@ -335,7 +332,6 @@ const videoMessage = async (req, res, next) => {
|
|
const idTime = Math.round(Date.now() / 1000);
|
|
const idTime = Math.round(Date.now() / 1000);
|
|
const isChat = await ChatModel.getByField(id, userId);
|
|
const isChat = await ChatModel.getByField(id, userId);
|
|
const isCompanionChat = await ChatModel.getByField(userId, id);
|
|
const isCompanionChat = await ChatModel.getByField(userId, id);
|
|
- const DIR_VIDEOS = process.env.DIR_VIDEOS;
|
|
|
|
const originalName = req.file.originalname;
|
|
const originalName = req.file.originalname;
|
|
const newNameVideo = `${Math.round(Date.now() / 1000)}${originalName}`;
|
|
const newNameVideo = `${Math.round(Date.now() / 1000)}${originalName}`;
|
|
const fullType = req.file.mimetype;
|
|
const fullType = req.file.mimetype;
|
|
@@ -413,7 +409,6 @@ const fileMessage = async (req, res, next) => {
|
|
const idTime = Math.round(Date.now() / 1000);
|
|
const idTime = Math.round(Date.now() / 1000);
|
|
const isChat = await ChatModel.getByField(id, userId);
|
|
const isChat = await ChatModel.getByField(id, userId);
|
|
const isCompanionChat = await ChatModel.getByField(userId, id);
|
|
const isCompanionChat = await ChatModel.getByField(userId, id);
|
|
- const DIR_FILES = process.env.DIR_FILES;
|
|
|
|
const originalName = req.file.originalname;
|
|
const originalName = req.file.originalname;
|
|
const fullType = req.file.mimetype;
|
|
const fullType = req.file.mimetype;
|
|
let type;
|
|
let type;
|