Browse Source

delete msg, remove spam timer if tribe owner, new delete msg type, deleted msg status

bugfix/timeout-logging
Evan Feenstra 5 years ago
parent
commit
1cb0b5a796
  1. 37
      api/controllers/chats.ts
  2. 2
      api/controllers/index.ts
  3. 36
      api/controllers/messages.ts
  4. 2
      api/network/receive.ts
  5. 34
      api/utils/timers.ts
  6. 3
      config/constants.json
  7. 36
      dist/api/controllers/chats.js
  8. 2
      dist/api/controllers/chats.js.map
  9. 2
      dist/api/controllers/index.js
  10. 2
      dist/api/controllers/index.js.map
  11. 36
      dist/api/controllers/messages.js
  12. 2
      dist/api/controllers/messages.js.map
  13. 2
      dist/api/network/receive.js
  14. 2
      dist/api/network/receive.js.map
  15. 39
      dist/api/utils/timers.js
  16. 2
      dist/api/utils/timers.js.map
  17. 3
      dist/config/constants.json

37
api/controllers/chats.ts

@ -8,14 +8,42 @@ import { sendNotification } from '../hub'
import * as md5 from 'md5' import * as md5 from 'md5'
import * as path from 'path' import * as path from 'path'
import * as tribes from '../utils/tribes' import * as tribes from '../utils/tribes'
import * as timers from '../utils/timers'
import {replayChatHistory,createTribeChatParams} from './chatTribes' import {replayChatHistory,createTribeChatParams} from './chatTribes'
const constants = require(path.join(__dirname,'../../config/constants.json')) const constants = require(path.join(__dirname,'../../config/constants.json'))
async function kickChatMember(){ async function kickChatMember(req, res){
// kick - remove from ChatMembers const chatId = parseInt(req.params['chat_id'])
// send group_leave to all ?? need to do this? const contactId = parseInt(req.params['contact_id'])
if(!chatId || !contactId) {
return failure(res, "missing param")
}
// remove chat.contactIds
let chat = await models.Chat.findOne({ where: { chatId } })
const contactIds = JSON.parse(chat.contactIds || '[]')
const newContactIds = contactIds.filter(cid=>cid!==contactId)
await chat.update({ contactIds: JSON.stringify(newContactIds) })
// remove from ChatMembers
await models.ChatMember.destroy({where:{
chatId, contactId,
}})
const contact = await models.Concat.findOne({where:{id:contactId}})
const members = {
[contact.publicKey]: {key:contact.contactKey, alias:contact.alias}
}
network.sendMessage({
chat: { ...chat.dataValues, contactIds:[contactId], members }, // send only to the guy u kicked
sender: contact,
message: {},
type: constants.message_types.group_leave,
})
// delete all timers for this member
timers.removeTimersByContactId(contactId)
success(res, true)
} }
async function getChats(req, res) { async function getChats(req, res) {
@ -324,6 +352,9 @@ async function receiveGroupLeave(payload) {
}) })
} }
} }
} else {
// check if im the only one in "members"
// and delete chat??
} }
var date = new Date(); var date = new Date();

2
api/controllers/index.ts

@ -38,7 +38,7 @@ async function set(app) {
app.post('/chats/:chat_id/:mute_unmute', chats.mute) app.post('/chats/:chat_id/:mute_unmute', chats.mute)
app.delete('/chat/:id', chats.deleteChat) app.delete('/chat/:id', chats.deleteChat)
app.put('/chat/:id', chats.addGroupMembers) app.put('/chat/:id', chats.addGroupMembers)
app.put('/kick/:id', chats.kickChatMember) app.put('/kick/:chat_id/:contact_id', chats.kickChatMember)
app.post('/tribe', chatTribes.joinTribe) app.post('/tribe', chatTribes.joinTribe)
app.put('/group/:id', chatTribes.editTribe) app.put('/group/:id', chatTribes.editTribe)

36
api/controllers/messages.ts

@ -6,6 +6,7 @@ import * as socket from '../utils/socket'
import * as jsonUtils from '../utils/json' import * as jsonUtils from '../utils/json'
import * as helpers from '../helpers' import * as helpers from '../helpers'
import { success } from '../utils/res' import { success } from '../utils/res'
import * as timers from '../utils/timers'
import {sendConfirmation} from './confirmations' import {sendConfirmation} from './confirmations'
import * as path from 'path' import * as path from 'path'
import * as network from '../network' import * as network from '../network'
@ -90,23 +91,30 @@ const getAllMessages = async (req, res) => {
}; };
async function deleteMessage(req, res){ async function deleteMessage(req, res){
const id = req.params.id const id = parseInt(req.params.id)
const {chat_id} = req.body const {chat_id} = req.body
const message = await models.Message.findOne({where:{id}}) const message = await models.Message.findOne({where:{id}})
const uuid = message.uuid const uuid = message.uuid
await models.Message.destroy({ where: {id} }) await message.update({status: constants.statuses.deleted})
success(res, {id}) success(res, {id})
if(chat_id) { if(chat_id) {
const chat = await models.Chat.findOne({where:{id:chat_id}}) const chat = await models.Chat.findOne({where:{id:chat_id}})
const owner = await models.Contact.findOne({ where: { isOwner: true }}) const isTribe = chat.type===constants.chat_types.tribe
network.sendMessage({ if(isTribe){
chat: chat, const owner = await models.Contact.findOne({ where: { isOwner: true }})
sender: owner, const isTribeOwner = owner.publicKey===chat.ownerPubkey
type: constants.message_types.delete, if(isTribeOwner) {
message: {id,uuid}, timers.removeTimerByMsgId(id)
}) network.sendMessage({
chat: chat,
sender: owner,
type: constants.message_types.delete,
message: {id,uuid},
})
}
}
} }
} }
@ -220,21 +228,23 @@ const receiveMessage = async (payload) => {
} }
const receiveDeleteMessage = async (payload) => { const receiveDeleteMessage = async (payload) => {
// console.log('received message', { payload }) console.log('=> received delete message')
const {owner, sender, chat, chat_type, msg_uuid} = await helpers.parseReceiveParams(payload) const {owner, sender, chat, chat_type, msg_uuid} = await helpers.parseReceiveParams(payload)
if(!owner || !sender || !chat) { if(!owner || !sender || !chat) {
return console.log('=> no group chat!') return console.log('=> no group chat!')
} }
// check the sender is the creator of the msg // check the sender is the creator of the msg?
const isTribe = chat_type===constants.chat_types.tribe const isTribe = chat_type===constants.chat_types.tribe
if(isTribe) { if(isTribe) {
// ? // ?
// if owner, delete timer? (if its not your own)
} }
await models.Message.destroy({where:{uuid:msg_uuid}}) const message = await models.Message.findOne({where:{uuid:msg_uuid}})
await message.update({status: constants.statuses.deleted})
socket.sendJson({ socket.sendJson({
type: 'delete', type: 'delete',
response: jsonUtils.messageToJson({uuid:msg_uuid}, chat, sender) response: jsonUtils.messageToJson(message, chat, sender)
}) })
} }

2
api/network/receive.ts

@ -17,8 +17,6 @@ import * as timers from '../utils/timers'
delete type: delete type:
owner needs to check that the delete is the one who made the msg owner needs to check that the delete is the one who made the msg
in receiveDeleteMessage check the deleter is og sender? in receiveDeleteMessage check the deleter is og sender?
*/ */
const constants = require(path.join(__dirname,'../../config/constants.json')) const constants = require(path.join(__dirname,'../../config/constants.json'))

34
api/utils/timers.ts

@ -4,26 +4,50 @@ import * as path from 'path'
const constants = require(path.join(__dirname,'../../config/constants.json')) const constants = require(path.join(__dirname,'../../config/constants.json'))
const timerz={}
function clearTimer(t){
const name = makeName(t)
clearTimeout(timerz[name])
}
export async function removeTimerByMsgId(msgId){
const t = await models.Timer.findOne({where:{msgId}})
clearTimer(t)
models.Timer.destroy({where:{msgId}})
}
export async function removeTimersByContactId(contactId){
const ts = await models.Timer.findAll({where:{receiver:contactId}})
ts.forEach(t=> clearTimer(t))
models.Timer.destroy({where:{receiver:contactId}})
}
export async function addTimer({amount, millis, receiver, msgId, chatId}){ export async function addTimer({amount, millis, receiver, msgId, chatId}){
const now = new Date().valueOf() const now = new Date().valueOf()
const when = now + millis const when = now + millis
const t = await models.Timer.create({ const t = await models.Timer.create({
amount, millis:when, receiver, msgId, chatId, amount, millis:when, receiver, msgId, chatId,
}) })
setTimer(when, async ()=>{ setTimer(makeName(t), when, async ()=>{
payBack(t) payBack(t)
}) })
} }
export function setTimer(when:number, cb){ export function setTimer(name:string, when:number, cb){
const now = new Date().valueOf() const now = new Date().valueOf()
const ms = when-now const ms = when-now
if(ms<0) cb() // fire right away if its already passed if(ms<0) {
else setTimeout(cb, ms) cb() // fire right away if its already passed
} else {
timerz[name] = setTimeout(cb, ms)
}
}
function makeName(t){
return `${t.chatId}_${t.receiver}_${t.msgId}`
} }
export async function reloadTimers(){ export async function reloadTimers(){
const timers = await models.Timer.findAll() const timers = await models.Timer.findAll()
timers && timers.forEach(t=>{ timers && timers.forEach(t=>{
setTimer(t.millis, async ()=>{ const name = makeName(t)
setTimer(name, t.millis, async ()=>{
payBack(t) payBack(t)
}) })
}) })

3
config/constants.json

@ -17,7 +17,8 @@
"confirmed": 1, "confirmed": 1,
"cancelled": 2, "cancelled": 2,
"received": 3, "received": 3,
"failed": 4 "failed": 4,
"deleted": 5
}, },
"message_types": { "message_types": {
"message": 0, "message": 0,

36
dist/api/controllers/chats.js

@ -19,12 +19,38 @@ const hub_1 = require("../hub");
const md5 = require("md5"); const md5 = require("md5");
const path = require("path"); const path = require("path");
const tribes = require("../utils/tribes"); const tribes = require("../utils/tribes");
const timers = require("../utils/timers");
const chatTribes_1 = require("./chatTribes"); const chatTribes_1 = require("./chatTribes");
const constants = require(path.join(__dirname, '../../config/constants.json')); const constants = require(path.join(__dirname, '../../config/constants.json'));
function kickChatMember() { function kickChatMember(req, res) {
return __awaiter(this, void 0, void 0, function* () { return __awaiter(this, void 0, void 0, function* () {
// kick - remove from ChatMembers const chatId = parseInt(req.params['chat_id']);
// send group_leave to all ?? need to do this? const contactId = parseInt(req.params['contact_id']);
if (!chatId || !contactId) {
return res_1.failure(res, "missing param");
}
// remove chat.contactIds
let chat = yield models_1.models.Chat.findOne({ where: { chatId } });
const contactIds = JSON.parse(chat.contactIds || '[]');
const newContactIds = contactIds.filter(cid => cid !== contactId);
yield chat.update({ contactIds: JSON.stringify(newContactIds) });
// remove from ChatMembers
yield models_1.models.ChatMember.destroy({ where: {
chatId, contactId,
} });
const contact = yield models_1.models.Concat.findOne({ where: { id: contactId } });
const members = {
[contact.publicKey]: { key: contact.contactKey, alias: contact.alias }
};
network.sendMessage({
chat: Object.assign(Object.assign({}, chat.dataValues), { contactIds: [contactId], members }),
sender: contact,
message: {},
type: constants.message_types.group_leave,
});
// delete all timers for this member
timers.removeTimersByContactId(contactId);
res_1.success(res, true);
}); });
} }
exports.kickChatMember = kickChatMember; exports.kickChatMember = kickChatMember;
@ -314,6 +340,10 @@ function receiveGroupLeave(payload) {
} }
} }
} }
else {
// check if im the only one in "members"
// and delete chat??
}
var date = new Date(); var date = new Date();
date.setMilliseconds(0); date.setMilliseconds(0);
if (date_string) if (date_string)

2
dist/api/controllers/chats.js.map

File diff suppressed because one or more lines are too long

2
dist/api/controllers/index.js

@ -45,7 +45,7 @@ function set(app) {
app.post('/chats/:chat_id/:mute_unmute', chats.mute); app.post('/chats/:chat_id/:mute_unmute', chats.mute);
app.delete('/chat/:id', chats.deleteChat); app.delete('/chat/:id', chats.deleteChat);
app.put('/chat/:id', chats.addGroupMembers); app.put('/chat/:id', chats.addGroupMembers);
app.put('/kick/:id', chats.kickChatMember); app.put('/kick/:chat_id/:contact_id', chats.kickChatMember);
app.post('/tribe', chatTribes.joinTribe); app.post('/tribe', chatTribes.joinTribe);
app.put('/group/:id', chatTribes.editTribe); app.put('/group/:id', chatTribes.editTribe);
app.post('/upload', uploads.avatarUpload.single('file'), uploads.uploadFile); app.post('/upload', uploads.avatarUpload.single('file'), uploads.uploadFile);

2
dist/api/controllers/index.js.map

File diff suppressed because one or more lines are too long

36
dist/api/controllers/messages.js

@ -17,6 +17,7 @@ const socket = require("../utils/socket");
const jsonUtils = require("../utils/json"); const jsonUtils = require("../utils/json");
const helpers = require("../helpers"); const helpers = require("../helpers");
const res_1 = require("../utils/res"); const res_1 = require("../utils/res");
const timers = require("../utils/timers");
const confirmations_1 = require("./confirmations"); const confirmations_1 = require("./confirmations");
const path = require("path"); const path = require("path");
const network = require("../network"); const network = require("../network");
@ -86,21 +87,28 @@ const getAllMessages = (req, res) => __awaiter(void 0, void 0, void 0, function*
exports.getAllMessages = getAllMessages; exports.getAllMessages = getAllMessages;
function deleteMessage(req, res) { function deleteMessage(req, res) {
return __awaiter(this, void 0, void 0, function* () { return __awaiter(this, void 0, void 0, function* () {
const id = req.params.id; const id = parseInt(req.params.id);
const { chat_id } = req.body; const { chat_id } = req.body;
const message = yield models_1.models.Message.findOne({ where: { id } }); const message = yield models_1.models.Message.findOne({ where: { id } });
const uuid = message.uuid; const uuid = message.uuid;
yield models_1.models.Message.destroy({ where: { id } }); yield message.update({ status: constants.statuses.deleted });
res_1.success(res, { id }); res_1.success(res, { id });
if (chat_id) { if (chat_id) {
const chat = yield models_1.models.Chat.findOne({ where: { id: chat_id } }); const chat = yield models_1.models.Chat.findOne({ where: { id: chat_id } });
const owner = yield models_1.models.Contact.findOne({ where: { isOwner: true } }); const isTribe = chat.type === constants.chat_types.tribe;
network.sendMessage({ if (isTribe) {
chat: chat, const owner = yield models_1.models.Contact.findOne({ where: { isOwner: true } });
sender: owner, const isTribeOwner = owner.publicKey === chat.ownerPubkey;
type: constants.message_types.delete, if (isTribeOwner) {
message: { id, uuid }, timers.removeTimerByMsgId(id);
}); network.sendMessage({
chat: chat,
sender: owner,
type: constants.message_types.delete,
message: { id, uuid },
});
}
}
} }
}); });
} }
@ -199,20 +207,22 @@ const receiveMessage = (payload) => __awaiter(void 0, void 0, void 0, function*
}); });
exports.receiveMessage = receiveMessage; exports.receiveMessage = receiveMessage;
const receiveDeleteMessage = (payload) => __awaiter(void 0, void 0, void 0, function* () { const receiveDeleteMessage = (payload) => __awaiter(void 0, void 0, void 0, function* () {
// console.log('received message', { payload }) console.log('=> received delete message');
const { owner, sender, chat, chat_type, msg_uuid } = yield helpers.parseReceiveParams(payload); const { owner, sender, chat, chat_type, msg_uuid } = yield helpers.parseReceiveParams(payload);
if (!owner || !sender || !chat) { if (!owner || !sender || !chat) {
return console.log('=> no group chat!'); return console.log('=> no group chat!');
} }
// check the sender is the creator of the msg // check the sender is the creator of the msg?
const isTribe = chat_type === constants.chat_types.tribe; const isTribe = chat_type === constants.chat_types.tribe;
if (isTribe) { if (isTribe) {
// ? // ?
// if owner, delete timer? (if its not your own)
} }
yield models_1.models.Message.destroy({ where: { uuid: msg_uuid } }); const message = yield models_1.models.Message.findOne({ where: { uuid: msg_uuid } });
yield message.update({ status: constants.statuses.deleted });
socket.sendJson({ socket.sendJson({
type: 'delete', type: 'delete',
response: jsonUtils.messageToJson({ uuid: msg_uuid }, chat, sender) response: jsonUtils.messageToJson(message, chat, sender)
}); });
}); });
exports.receiveDeleteMessage = receiveDeleteMessage; exports.receiveDeleteMessage = receiveDeleteMessage;

2
dist/api/controllers/messages.js.map

File diff suppressed because one or more lines are too long

2
dist/api/network/receive.js

@ -27,8 +27,6 @@ const timers = require("../utils/timers");
delete type: delete type:
owner needs to check that the delete is the one who made the msg owner needs to check that the delete is the one who made the msg
in receiveDeleteMessage check the deleter is og sender? in receiveDeleteMessage check the deleter is og sender?
*/ */
const constants = require(path.join(__dirname, '../../config/constants.json')); const constants = require(path.join(__dirname, '../../config/constants.json'));
const msgtypes = constants.message_types; const msgtypes = constants.message_types;

2
dist/api/network/receive.js.map

File diff suppressed because one or more lines are too long

39
dist/api/utils/timers.js

@ -13,6 +13,27 @@ const models_1 = require("../models");
const network = require("../network"); const network = require("../network");
const path = require("path"); const path = require("path");
const constants = require(path.join(__dirname, '../../config/constants.json')); const constants = require(path.join(__dirname, '../../config/constants.json'));
const timerz = {};
function clearTimer(t) {
const name = makeName(t);
clearTimeout(timerz[name]);
}
function removeTimerByMsgId(msgId) {
return __awaiter(this, void 0, void 0, function* () {
const t = yield models_1.models.Timer.findOne({ where: { msgId } });
clearTimer(t);
models_1.models.Timer.destroy({ where: { msgId } });
});
}
exports.removeTimerByMsgId = removeTimerByMsgId;
function removeTimersByContactId(contactId) {
return __awaiter(this, void 0, void 0, function* () {
const ts = yield models_1.models.Timer.findAll({ where: { receiver: contactId } });
ts.forEach(t => clearTimer(t));
models_1.models.Timer.destroy({ where: { receiver: contactId } });
});
}
exports.removeTimersByContactId = removeTimersByContactId;
function addTimer({ amount, millis, receiver, msgId, chatId }) { function addTimer({ amount, millis, receiver, msgId, chatId }) {
return __awaiter(this, void 0, void 0, function* () { return __awaiter(this, void 0, void 0, function* () {
const now = new Date().valueOf(); const now = new Date().valueOf();
@ -20,26 +41,32 @@ function addTimer({ amount, millis, receiver, msgId, chatId }) {
const t = yield models_1.models.Timer.create({ const t = yield models_1.models.Timer.create({
amount, millis: when, receiver, msgId, chatId, amount, millis: when, receiver, msgId, chatId,
}); });
setTimer(when, () => __awaiter(this, void 0, void 0, function* () { setTimer(makeName(t), when, () => __awaiter(this, void 0, void 0, function* () {
payBack(t); payBack(t);
})); }));
}); });
} }
exports.addTimer = addTimer; exports.addTimer = addTimer;
function setTimer(when, cb) { function setTimer(name, when, cb) {
const now = new Date().valueOf(); const now = new Date().valueOf();
const ms = when - now; const ms = when - now;
if (ms < 0) if (ms < 0) {
cb(); // fire right away if its already passed cb(); // fire right away if its already passed
else }
setTimeout(cb, ms); else {
timerz[name] = setTimeout(cb, ms);
}
} }
exports.setTimer = setTimer; exports.setTimer = setTimer;
function makeName(t) {
return `${t.chatId}_${t.receiver}_${t.msgId}`;
}
function reloadTimers() { function reloadTimers() {
return __awaiter(this, void 0, void 0, function* () { return __awaiter(this, void 0, void 0, function* () {
const timers = yield models_1.models.Timer.findAll(); const timers = yield models_1.models.Timer.findAll();
timers && timers.forEach(t => { timers && timers.forEach(t => {
setTimer(t.millis, () => __awaiter(this, void 0, void 0, function* () { const name = makeName(t);
setTimer(name, t.millis, () => __awaiter(this, void 0, void 0, function* () {
payBack(t); payBack(t);
})); }));
}); });

2
dist/api/utils/timers.js.map

@ -1 +1 @@
{"version":3,"file":"timers.js","sourceRoot":"","sources":["../../../api/utils/timers.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,sCAAkC;AAClC,sCAAqC;AACrC,6BAA4B;AAE5B,MAAM,SAAS,GAAG,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,SAAS,EAAC,6BAA6B,CAAC,CAAC,CAAA;AAE7E,SAAsB,QAAQ,CAAC,EAAC,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,EAAC;;QACpE,MAAM,GAAG,GAAG,IAAI,IAAI,EAAE,CAAC,OAAO,EAAE,CAAA;QAChC,MAAM,IAAI,GAAG,GAAG,GAAG,MAAM,CAAA;QACzB,MAAM,CAAC,GAAG,MAAM,eAAM,CAAC,KAAK,CAAC,MAAM,CAAC;YAChC,MAAM,EAAE,MAAM,EAAC,IAAI,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM;SAC/C,CAAC,CAAA;QACF,QAAQ,CAAC,IAAI,EAAE,GAAQ,EAAE;YACrB,OAAO,CAAC,CAAC,CAAC,CAAA;QACd,CAAC,CAAA,CAAC,CAAA;IACN,CAAC;CAAA;AATD,4BASC;AACD,SAAgB,QAAQ,CAAC,IAAW,E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received": 3,
"failed": 4 "failed": 4,
"deleted": 5
}, },
"message_types": { "message_types": {
"message": 0, "message": 0,

Loading…
Cancel
Save