From 626a3d69e90e549b820458c691225bed97852c80 Mon Sep 17 00:00:00 2001 From: Evan Feenstra Date: Fri, 20 Nov 2020 11:39:35 -0800 Subject: [PATCH] record amts in all msgs, boost msg, if admin sends boost send separat keysend --- dist/src/controllers/messages.js | 39 +++++++++++++++++++++++++--- dist/src/controllers/messages.js.map | 2 +- dist/src/network/receive.js | 7 ++--- dist/src/network/receive.js.map | 2 +- src/controllers/messages.ts | 39 +++++++++++++++++++++++++--- src/network/receive.ts | 6 ++--- 6 files changed, 79 insertions(+), 16 deletions(-) diff --git a/dist/src/controllers/messages.js b/dist/src/controllers/messages.js index a607964..a5720ec 100644 --- a/dist/src/controllers/messages.js +++ b/dist/src/controllers/messages.js @@ -22,6 +22,7 @@ const confirmations_1 = require("./confirmations"); const network = require("../network"); const short = require("short-uuid"); const constants_1 = require("../constants"); +const receive_1 = require("../network/receive"); exports.getMessages = (req, res) => __awaiter(void 0, void 0, void 0, function* () { const dateToReturn = req.query.date; if (!dateToReturn) { @@ -184,10 +185,40 @@ exports.sendMessage = (req, res) => __awaiter(void 0, void 0, void 0, function* type: msgtype, message: msgToSend, }); + const isTribe = chat.type === constants_1.default.chat_types.tribe; + const isTribeOwner = isTribe && owner.publicKey === chat.ownerPubkey; + if (isTribeOwner && reply_uuid && boost && amount) { + processTribeAdminBoost(chat, reply_uuid, amount); + } }); +function processTribeAdminBoost(chat, reply_uuid, amount) { + return __awaiter(this, void 0, void 0, function* () { + const ogMsg = yield models_1.models.Message.findOne({ where: { + uuid: reply_uuid, + } }); + if (ogMsg && ogMsg.sender && ogMsg.sender !== 1) { + receive_1.forwardBoostSatsToContact(chat, ogMsg.sender, amount); + var date = new Date(); + date.setMilliseconds(0); + models_1.models.Message.create({ + chatId: 0, + type: constants_1.default.message_types.keysend, + sender: 1, + amount, + amountMsat: amount * 1000, + paymentHash: '', + date: date, + messageContent: '!', + status: constants_1.default.statuses.confirmed, + createdAt: date, + updatedAt: date + }); + } + }); +} exports.receiveMessage = (payload) => __awaiter(void 0, void 0, void 0, function* () { // console.log('received message', { payload }) - const { owner, sender, chat, content, remote_content, msg_id, chat_type, sender_alias, msg_uuid, date_string, reply_uuid } = yield helpers.parseReceiveParams(payload); + const { owner, sender, chat, content, remote_content, msg_id, chat_type, sender_alias, msg_uuid, date_string, reply_uuid, amount } = yield helpers.parseReceiveParams(payload); if (!owner || !sender || !chat) { return console.log('=> no group chat!'); } @@ -202,7 +233,7 @@ exports.receiveMessage = (payload) => __awaiter(void 0, void 0, void 0, function type: constants_1.default.message_types.message, sender: sender.id, date: date, - // amount: amount||0, + amount: amount || 0, messageContent: text, createdAt: date, updatedAt: date, @@ -227,7 +258,7 @@ exports.receiveMessage = (payload) => __awaiter(void 0, void 0, void 0, function }); exports.receiveBoost = (payload) => __awaiter(void 0, void 0, void 0, function* () { console.log('received boost', { payload }); - const { owner, sender, chat, content, remote_content, chat_type, sender_alias, msg_uuid, date_string, reply_uuid } = yield helpers.parseReceiveParams(payload); + const { owner, sender, chat, content, remote_content, chat_type, sender_alias, msg_uuid, date_string, reply_uuid, amount } = yield helpers.parseReceiveParams(payload); if (!owner || !sender || !chat) { return console.log('=> no group chat!'); } @@ -242,7 +273,7 @@ exports.receiveBoost = (payload) => __awaiter(void 0, void 0, void 0, function* type: constants_1.default.message_types.boost, sender: sender.id, date: date, - // amount: amount||0, + amount: amount || 0, messageContent: text, createdAt: date, updatedAt: date, diff --git a/dist/src/controllers/messages.js.map b/dist/src/controllers/messages.js.map index 984c199..d21d21b 100644 --- a/dist/src/controllers/messages.js.map +++ b/dist/src/controllers/messages.js.map @@ -1 +1 @@ -{"version":3,"file":"messages.js","sourceRoot":"","sources":["../../../src/controllers/messages.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,sCAAgC;AAChC,yCAA8B;AAC9B,2CAAoC;AACpC,gCAAyC;AACzC,0CAAyC;AACzC,2CAA0C;AAC1C,sCAAqC;AACrC,sCAA+C;AAC/C,0CAAyC;AACzC,mDAAgD;AAChD,sCAAqC;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AACF,CAAC,CAAA,CAAA;AAEY,QAAA,aAAa,GAAG,CAAC,GAAG,EAAE,GAAG,EAAE,EAAE;IACzC,eAAM,CAAC,OAAO,CAAC,OAAO,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC,CAAA;IAErD,aAAO,CAAC,GAAG,EAAE,EAAE,CAAC,CAAA;AACjB,CAAC,CAAA"} \ No newline at end of file +{"version":3,"file":"messages.js","sourceRoot":"","sources":["../../../src/controllers/messages.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,sCAAgC;AAChC,yCAA8B;AAC9B,2CAAoC;AACpC,gCAAyC;AACzC,0CAAyC;AACzC,2CAA0C;AAC1C,sCAAqC;AACrC,sCAA+C;AAC/C,0CAAyC;AACzC,mDAAgD;AAChD,sCAAqC;AACrC,oCAAmC;AACnC,4CAAoC;AACpC,gDAA4D;AAE/C,QAAA,WAAW,GAAG,CAAO,GAAG,EAAE,GAAG,EAAE,EAAE;IAC7C,MAAM,YAAY,GAAG,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC;IAEpC,IAAI,CAAC,YAAY,EAAE;QAClB,OAAO,sBAAc,CAAC,GAAG,EAAE,GAAG,CAAC,CAAA;KAC/B;IACD,OAAO,CAAC,GAAG,CAAC,YAAY,CAAC,CAAA;IACzB,MAAM,KAAK,GAAG,MAAM,eAAM,CAAC,OAAO,CAAC,OAAO,CAAC,EAAE,KAAK,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE,EAAE,CAAC,CAAA;IACxE,mCAAmC;IAEnC,IAAI,gBAAgB,GAAG;QACtB,IAAI,EAAE,EAAE,CAAC,cAAE,CAAC,GAAG,CAAC,EAAE,YAAY,EAAE;QAChC,CAAC,cAAE,CAAC,EAAE,CAAC,EAAE;YACR,EAAC,QAAQ,EAAE,KAAK,CAAC,EAAE,EAAC;YACpB,EAAC,QAAQ,EAAE,IAAI,EAAC;SAChB;KACD,CAAA;IAED,IAAI,sBAAsB,GA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AAM,eAAM,CAAC,IAAI,CAAC,OAAO,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE,EAAE,OAAO,EAAE,EAAE,CAAC,CAAA;IAClE,IAAG,IAAI,EAAE;QACR,MAAM,IAAI,CAAC,MAAM,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC;QAClC,aAAO,CAAC,GAAG,EAAE,EAAE,CAAC,CAAA;QAChB,sBAAgB,CAAC,IAAI,EAAE,EAAE,EAAE,OAAO,CAAC,CAAA;QACnC,MAAM,CAAC,QAAQ,CAAC;YACf,IAAI,EAAE,WAAW;YACjB,QAAQ,EAAE,SAAS,CAAC,UAAU,CAAC,IAAI,CAAC;SACpC,CAAC,CAAA;KACF;SAAM;QACN,aAAO,CAAC,GAAG,EAAE,SAAS,CAAC,CAAA;KACvB;AACF,CAAC,CAAA,CAAA;AAEY,QAAA,aAAa,GAAG,CAAC,GAAG,EAAE,GAAG,EAAE,EAAE;IACzC,eAAM,CAAC,OAAO,CAAC,OAAO,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC,CAAA;IAErD,aAAO,CAAC,GAAG,EAAE,EAAE,CAAC,CAAA;AACjB,CAAC,CAAA"} \ No newline at end of file diff --git a/dist/src/network/receive.js b/dist/src/network/receive.js index 52ac46b..b62133e 100644 --- a/dist/src/network/receive.js +++ b/dist/src/network/receive.js @@ -143,7 +143,7 @@ function onReceive(payload) { if (ogMsg && ogMsg.sender && ogMsg.sender !== 1) { const amtToForward = payload.message.amount - (chat.pricePerMessage || 0) - (chat.escrowAmount || 0); if (amtToForward > 0) { - forwardSatsToContact(chat, ogMsg.sender, amtToForward); + forwardBoostSatsToContact(chat, ogMsg.sender, amtToForward); } } } @@ -203,9 +203,9 @@ function doTheAction(data) { } }); } -function forwardSatsToContact(chat, contactId, amount) { +function forwardBoostSatsToContact(chat, contactId, amount) { return __awaiter(this, void 0, void 0, function* () { - console.log('=> forwardSatsToContact', contactId); + console.log('=> forwardBoostSatsToContact', contactId); const owner = yield models_1.models.Contact.findOne({ where: { isOwner: true } }); send_1.sendMessage({ chat: Object.assign(Object.assign({}, chat.dataValues), { contactIds: [contactId] }), @@ -218,6 +218,7 @@ function forwardSatsToContact(chat, contactId, amount) { }); }); } +exports.forwardBoostSatsToContact = forwardBoostSatsToContact; function forwardMessageToTribe(ogpayload, sender) { return __awaiter(this, void 0, void 0, function* () { // console.log('forwardMessageToTribe') diff --git a/dist/src/network/receive.js.map b/dist/src/network/receive.js.map index c458539..52b00a2 100644 --- a/dist/src/network/receive.js.map +++ b/dist/src/network/receive.js.map @@ -1 +1 @@ -{"version":3,"file":"receive.js","sourceRoot":"","sources":["../../../src/network/receive.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,sCAAqC;AACrC,kDAA0C;AAC1C,gDAAsC;AACtC,0CAAyC;AACzC,kDAA2D;AAC3D,0CAAyC;AACzC,sCAAkC;AAClC,iCAAkC;AAClC,qCAA8G;AAC9G,sCAAiE;AACjE,yCAA8B;AAC9B,0CAAyC;AACzC,0CAAyC;AACzC,gCAAyC;AACzC,4CAAoC;AACpC,2CAA0C;AAE1C;;;;EAIE;AAEF,MAAM,QAAQ,GAAG,mBAAS,CAAC,aAAa,CAAA;AAE3B,QAAA,cAAc,GAAC;IAC3B,QAAQ,CAAC,OAAO,EAAE,QAAQ,CAAC,UAAU,EAAE,QAAQ,CAAC,WAAW;IAC3D,QAAQ,CAAC,UAAU,EAAE,QAAQ,CAAC,MAAM,EAAE,QAAQ,CAAC,KAAK;CACpD,CAAA;AACD,MAAM,aAAa,GAAC;IACnB,QAAQ,CAAC,UAAU;CACnB,CAAA;AACD,MAAM,4BAA4B,GAAG;IACpC,QAAQ,CAAC,OAAO,EAAE,QAAQ,CAAC,UAAU,EAAE,QAAQ,CAAC,KAAK;CACrD,CAAA;AACY,QAAA,aAAa,GAAC;IAC1B,QAAQ,CAAC,OAAO;IAChB,QAAQ,CAAC,UAAU;IACnB,QAAQ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C,CAAC,CAAC,CAAA;IACf,MAAM,CAAC,GAAG,EAAE,CAAC,MAAM,CAAC,CAAC,CAAC,EAAC,CAAC,EAAC,EAAE,CAAA,CAAC,GAAC,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAA;IACzC,MAAM,CAAC,EAAE,CAAC,GAAG,MAAM,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,MAAM,CAAC,EAAE,CAAC,EAAE,EAAC,CAAC,EAAC,CAAC,EAAC,CAAC,EAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAAC,CAAC,EAAC,CAAC,EAAC,CAAC,EAAC,CAAC,CAAA;IAC9D,IAAG,MAAM,CAAC,EAAE,CAAC,CAAC,MAAM,KAAG,QAAQ,CAAC,CAAC,CAAC,EAAC;QAClC,cAAc;QACd,MAAM,GAAG,GAAG,MAAM,CAAC,EAAE,CAAC,CAAA;QACtB,IAAI,OAAO,GAAG,EAAE,CAAA;QAChB,GAAG,CAAC,KAAK,EAAE,CAAC,IAAI,CAAC,CAAC,CAAC,EAAC,CAAC,EAAC,EAAE,CAAA,CAAC,CAAC,CAAC,GAAC,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,GAAG,CAAA,EAAE;YAC7C,OAAO,IAAI,GAAG,CAAC,CAAC,CAAA;QACjB,CAAC,CAAC,CAAA;QACF,OAAO,MAAM,CAAC,EAAE,CAAC,CAAA;QACjB,OAAO,OAAO,CAAA;KACd;AACF,CAAC"} \ No newline at end of file diff --git a/src/controllers/messages.ts b/src/controllers/messages.ts index 902e1b7..853c283 100644 --- a/src/controllers/messages.ts +++ b/src/controllers/messages.ts @@ -11,6 +11,7 @@ import {sendConfirmation} from './confirmations' import * as network from '../network' import * as short from 'short-uuid' import constants from '../constants' +import {forwardBoostSatsToContact} from '../network/receive' export const getMessages = async (req, res) => { const dateToReturn = req.query.date; @@ -206,12 +207,42 @@ export const sendMessage = async (req, res) => { type: msgtype, message: msgToSend, }) + + const isTribe = chat.type===constants.chat_types.tribe + const isTribeOwner = isTribe && owner.publicKey===chat.ownerPubkey + if(isTribeOwner && reply_uuid && boost && amount) { + processTribeAdminBoost(chat, reply_uuid, amount) + } +} + +async function processTribeAdminBoost(chat, reply_uuid, amount){ + const ogMsg = await models.Message.findOne({where:{ + uuid: reply_uuid, + }}) + if(ogMsg && ogMsg.sender && ogMsg.sender!==1) { + forwardBoostSatsToContact(chat,ogMsg.sender,amount) + var date = new Date(); + date.setMilliseconds(0) + models.Message.create({ // gen keysend record on owner side + chatId: 0, + type: constants.message_types.keysend, + sender: 1, + amount, + amountMsat: amount*1000, + paymentHash: '', + date: date, + messageContent: '!', + status: constants.statuses.confirmed, + createdAt: date, + updatedAt: date + }) + } } export const receiveMessage = async (payload) => { // console.log('received message', { payload }) - const {owner, sender, chat, content, remote_content, msg_id, chat_type, sender_alias, msg_uuid, date_string, reply_uuid} = await helpers.parseReceiveParams(payload) + const {owner, sender, chat, content, remote_content, msg_id, chat_type, sender_alias, msg_uuid, date_string, reply_uuid, amount} = await helpers.parseReceiveParams(payload) if(!owner || !sender || !chat) { return console.log('=> no group chat!') } @@ -227,7 +258,7 @@ export const receiveMessage = async (payload) => { type: constants.message_types.message, sender: sender.id, date: date, - // amount: amount||0, + amount: amount||0, messageContent: text, createdAt: date, updatedAt: date, @@ -255,7 +286,7 @@ export const receiveMessage = async (payload) => { export const receiveBoost = async (payload) => { console.log('received boost', { payload }) - const {owner, sender, chat, content, remote_content, chat_type, sender_alias, msg_uuid, date_string, reply_uuid} = await helpers.parseReceiveParams(payload) + const {owner, sender, chat, content, remote_content, chat_type, sender_alias, msg_uuid, date_string, reply_uuid, amount} = await helpers.parseReceiveParams(payload) if(!owner || !sender || !chat) { return console.log('=> no group chat!') } @@ -271,7 +302,7 @@ export const receiveBoost = async (payload) => { type: constants.message_types.boost, sender: sender.id, date: date, - // amount: amount||0, + amount: amount||0, messageContent: text, createdAt: date, updatedAt: date, diff --git a/src/network/receive.ts b/src/network/receive.ts index d8d5344..8e2388b 100644 --- a/src/network/receive.ts +++ b/src/network/receive.ts @@ -129,7 +129,7 @@ async function onReceive(payload){ if(ogMsg && ogMsg.sender && ogMsg.sender!==1) { const amtToForward = payload.message.amount - (chat.pricePerMessage||0) - (chat.escrowAmount||0) if(amtToForward>0) { - forwardSatsToContact(chat,ogMsg.sender,amtToForward) + forwardBoostSatsToContact(chat,ogMsg.sender,amtToForward) } } } @@ -183,8 +183,8 @@ async function doTheAction(data){ } } -async function forwardSatsToContact(chat,contactId:number,amount:number) { - console.log('=> forwardSatsToContact',contactId) +export async function forwardBoostSatsToContact(chat,contactId:number,amount:number) { + console.log('=> forwardBoostSatsToContact',contactId) const owner = await models.Contact.findOne({where:{isOwner:true}}) sendMessage({ chat: {...chat.dataValues, contactIds:[contactId]},