diff --git a/api/controllers/confirmations.ts b/api/controllers/confirmations.ts index cf2da0d..987358d 100644 --- a/api/controllers/confirmations.ts +++ b/api/controllers/confirmations.ts @@ -17,7 +17,7 @@ export function sendConfirmation({ chat, sender, msg_id }) { } export async function receiveConfirmation(payload) { - console.log('=> received confirmation') + console.log('=> received confirmation', JSON.stringify(payload)) const dat = payload.content || payload const chat_uuid = dat.chat.uuid diff --git a/api/controllers/messages.ts b/api/controllers/messages.ts index acd2050..24ed9fa 100644 --- a/api/controllers/messages.ts +++ b/api/controllers/messages.ts @@ -183,7 +183,8 @@ const receiveMessage = async (payload) => { updatedAt: date, status: constants.statuses.received } - if(chat_type===constants.chat_types.tribe) { + const isTribe = chat_type===constants.chat_types.tribe + if(isTribe) { msg.senderAlias = sender_alias if(remote_content) msg.remoteMessageContent=remote_content } diff --git a/api/models/ts/timer.ts b/api/models/ts/timer.ts index 30a1d95..225c8f7 100644 --- a/api/models/ts/timer.ts +++ b/api/models/ts/timer.ts @@ -11,6 +11,9 @@ export default class Timer extends Model { }) id: number + @Column(DataType.BIGINT) + chatId: number + @Column(DataType.BIGINT) millis: number diff --git a/api/network/send.ts b/api/network/send.ts index e7899ca..46403a4 100644 --- a/api/network/send.ts +++ b/api/network/send.ts @@ -10,8 +10,7 @@ type NetworkType = undefined | 'mqtt' | 'lightning' export async function sendMessage(params) { const { type, chat, message, sender, amount, success, failure, skipPubKey } = params - const m = newmsg(type, chat, sender, message) - let msg = m + let msg = newmsg(type, chat, sender, message) // console.log(type,message) if(!(sender&&sender.publicKey)) { @@ -32,9 +31,9 @@ export async function sendMessage(params) { let isTribeOwner = false const chatUUID = chat.uuid if(isTribe) { - if(type===constants.message_types.confirmation) { - return // dont send confs for tribe - } + // if(type===constants.message_types.confirmation) { + // return // dont send confs for tribe + // } console.log("is tribe!") const tribeOwnerPubKey = chat.ownerPubkey if(sender.publicKey===tribeOwnerPubKey){ diff --git a/api/utils/setup.ts b/api/utils/setup.ts index 4618f48..e6f6832 100644 --- a/api/utils/setup.ts +++ b/api/utils/setup.ts @@ -35,9 +35,11 @@ async function migrate(){ await sequelize.query(` CREATE TABLE sphinx_timers ( id BIGINT, + chat_id BIGINT, receiver BIGINT, millis BIGINT, - amount DECIMAL + amount DECIMAL, + ref BIGINT )`) } catch(e){console.log(e)} addTableColumn('sphinx_chats', 'escrow_amount', 'BIGINT') diff --git a/api/utils/timers.ts b/api/utils/timers.ts index 05d1db2..ca9aba0 100644 --- a/api/utils/timers.ts +++ b/api/utils/timers.ts @@ -1,5 +1,8 @@ import { models } from '../models' import * as network from '../network' +import * as path from 'path' + +const constants = require(path.join(__dirname,'../../config/constants.json')) export async function addTimer({amount, millis, receiver}){ const now = new Date().valueOf() @@ -27,13 +30,16 @@ export async function reloadTimers(){ } export async function payBack(t){ console.log("PAY BACK") - const contact = await models.Contact.findOne({where:{id:t.receiver}}) - if(contact){ - console.log("SEND ",t.amount,"TO",contact.publicKey) - network.signAndSend({ - amt: t.amount, - dest: contact.publicKey, - }) - } + const chat = await models.Chat.findOne({ where: {id:t.chatId} }) + const owner = await models.Contact.findOne({ where: {isOwner:true} }) + if(!chat) return + const theChat = {...chat.dataValues, contactIds:[t.receiver]} + network.sendMessage({ + chat: theChat, + sender: owner, + message: {id:t.ref}, + amount: t.amount, + type: constants.message_types.confirmation, + }) models.Timer.destroy({where:{id:t.id}}) } diff --git a/dist/api/controllers/confirmations.js b/dist/api/controllers/confirmations.js index 5633f5f..7563555 100644 --- a/dist/api/controllers/confirmations.js +++ b/dist/api/controllers/confirmations.js @@ -27,7 +27,7 @@ function sendConfirmation({ chat, sender, msg_id }) { exports.sendConfirmation = sendConfirmation; function receiveConfirmation(payload) { return __awaiter(this, void 0, void 0, function* () { - console.log('=> received confirmation'); + console.log('=> received confirmation', JSON.stringify(payload)); const dat = payload.content || payload; const chat_uuid = dat.chat.uuid; const msg_id = dat.message.id; diff --git a/dist/api/controllers/confirmations.js.map b/dist/api/controllers/confirmations.js.map index d2a0ff8..87de9e1 100644 --- a/dist/api/controllers/confirmations.js.map +++ b/dist/api/controllers/confirmations.js.map @@ -1 +1 @@ -{"version":3,"file":"confirmations.js","sourceRoot":"","sources":["../../../api/controllers/confirmations.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,wCAAgC;AAChC,sCAAgC;AAChC,0CAAyC;AACzC,2CAA0C;AAC1C,sCAAqC;AACrC,6BAA4B;AAE5B,MAAM,SAAS,GAAG,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,SAAS,EAAC,6BAA6B,CAAC,CAAC,CAAA;AAE7E,SAAgB,gBAAgB,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE;IACxD,OAAO,CAAC,WAAW,CAAC;QACnB,IAAI;QACJ,MAAM;QACN,OAAO,EAAE,EAAC,EAAE,EAAC,MAAM,EAAC;QACpB,IAAI,EAAE,SAAS,CAAC,aAAa,CAAC,YAAY;KAC1C,CAAC,CAAA;AACH,CAAC;AAPD,4CAOC;AAED,SAAsB,mBAAmB,CAAC,OAAO;;QAChD,OAAO,CAAC,GAAG,CAAC,0BAA0B,CAAC,CAAA;QAEvC,MAAM,GAAG,GAAG,OAAO,CAAC,OAAO,IAAI,OAAO,CAAA;QACtC,MAAM,SAAS,GAAG,GAAG,CAAC,IAAI,CAAC,IAAI,CAAA;QAC/B,MAAM,MAAM,GAAG,GAAG,CAAC,OAAO,CAAC,EAAE,CAAA;QAC7B,MAAM,cAAc,GAAG,GAAG,CAAC,MAAM,CAAC,OAAO,CAAA;QAEzC,MAAM,KAAK,GAAG,MAAM,eAAM,CAAC,OAAO,CAAC,OAAO,CAAC,EAAE,KAAK,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE,EAAC,CAAC,CAAA;QACvE,MAAM,MAAM,GAAG,MAAM,eAAM,CAAC,OAAO,CAAC,OAAO,CAAC,EAAE,KAAK,EAAE,EAAE,SAAS,EAAE,cAAc,EAAE,EAAE,CAAC,CAAA;QACrF,MAAM,IAAI,GAAG,MAAM,eAAM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KAAK,CAAC,EAAE;oBAChB,IAAI,EAAE;wBACL,SAAS,CAAC,aAAa,CAAC,OAAO;wBAC/B,SAAS,CAAC,aAAa,CAAC,OAAO;wBAC/B,SAAS,CAAC,aAAa,CAAC,UAAU;qBAClC;oBACD,MAAM,EAAE,SAAS,CAAC,QAAQ,CAAC,OAAO;iBAClC;gBACD,KAAK,EAAE,CAAC,CAAC,WAAW,EAAE,MAAM,CAAC,CAAC;aAC9B,CAAC,CAAA;YAEF,MAAM,OAAO,GAAG,QAAQ,CAAC,CAAC,CAAC,CAAA;YAC3B,OAAO,CAAC,MAAM,CAAC,EAAE,MAAM,EAAE,SAAS,CAAC,QAAQ,CAAC,QAAQ,EAAE,CAAC,CAAA;YAEvD,MAAM,CAAC,QAAQ,CAAC;gBACf,IAAI,EAAE,cAAc;gBACpB,QAAQ,EAAE,SAAS,CAAC,aAAa,CAAC,OAAO,EAAE,IAAI,EAAE,MAAM,CAAC;aACxD,CAAC,CAAA;SACF;IACF,CAAC;CAAA;AA3DD,kDA2DC"} \ No newline at end of file +{"version":3,"file":"confirmations.js","sourceRoot":"","sources":["../../../api/controllers/confirmations.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,wCAAgC;AAChC,sCAAgC;AAChC,0CAAyC;AACzC,2CAA0C;AAC1C,sCAAqC;AACrC,6BAA4B;AAE5B,MAAM,SAAS,GAAG,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,SAAS,EAAC,6BAA6B,CAAC,CAAC,CAAA;AAE7E,SAAgB,gBAAgB,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE;IACxD,OAAO,CAAC,WAAW,CAAC;QACnB,IAAI;QACJ,MAAM;QACN,OAAO,EAAE,EAAC,EAAE,EAAC,MAAM,EAAC;QACpB,IAAI,EAAE,SAAS,CAAC,aAAa,CAAC,YAAY;KAC1C,CAAC,CAAA;AACH,CAAC;AAPD,4CAOC;AAED,SAAsB,mBAAmB,CAAC,OAAO;;QAChD,OAA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SACF;IACF,CAAC;CAAA;AA3DD,kDA2DC"} \ No newline at end of file diff --git a/dist/api/controllers/messages.js b/dist/api/controllers/messages.js index 570b4a5..d5e9428 100644 --- a/dist/api/controllers/messages.js +++ b/dist/api/controllers/messages.js @@ -166,7 +166,8 @@ const receiveMessage = (payload) => __awaiter(void 0, void 0, void 0, function* updatedAt: date, status: constants.statuses.received }; - if (chat_type === constants.chat_types.tribe) { + const isTribe = chat_type === constants.chat_types.tribe; + if (isTribe) { msg.senderAlias = sender_alias; if (remote_content) msg.remoteMessageContent = remote_content; diff --git a/dist/api/controllers/messages.js.map b/dist/api/controllers/messages.js.map index 88974a9..4913f57 100644 --- a/dist/api/controllers/messages.js.map +++ b/dist/api/controllers/messages.js.map @@ -1 +1 @@ -{"version":3,"file":"messages.js","sourceRoot":"","sources":["../../../api/controllers/messages.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,sCAAgC;AAChC,yCAA8B;AAC9B,2CAAoC;AACpC,gCAAyC;AACzC,0CAAyC;AACzC,2CAA0C;AAC1C,sCAAqC;AACrC,sCAAsC;AACtC,mDAAgD;AAChD,6BAA4B;AAC5B,sCAAqC;AACrC,oCAAmC;AAEnC,MAAM,SAAS,GAAG,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,SAAS,EAAC,6BAA6B,CAAC,CAAC,CAAA;AAE7E,MAAM,WAAW,GAAG,CAAO,GAAG,EAAE,GAAG,EAAE,EAAE;IACtC,MAAM,YAAY,GAAG,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC;IAEpC,IAAI,CAAC,YAAY,EAAE;QAClB,OAAO,cAAc,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,mCA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,MAAM,KAAK,GAAG,MAAM,eAAM,CAAC,OAAO,CAAC,OAAO,CAAC,EAAE,KAAK,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE,EAAC,CAAC,CAAA;IAEvE,eAAM,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,EAAE;QACrC,KAAK,EAAE;YACL,MAAM,EAAE;gBACT,CAAC,cAAE,CAAC,EAAE,CAAC,EAAE,KAAK,CAAC,EAAE;aACf;YACD,MAAM,EAAE,OAAO;SAChB;KACD,CAAC,CAAC;IAEH,aAAO,CAAC,GAAG,EAAE,EAAE,CAAC,CAAA;AACjB,CAAC,CAAA,CAAA;AAaC,oCAAY;AAXd,MAAM,aAAa,GAAG,CAAC,GAAG,EAAE,GAAG,EAAE,EAAE;IAClC,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;AAMC,sCAAa"} \ No newline at end of file +{"version":3,"file":"messages.js","sourceRoot":"","sources":["../../../api/controllers/messages.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,sCAAgC;AAChC,yCAA8B;AAC9B,2CAAoC;AACpC,gCAAyC;AACzC,0CAAyC;AACzC,2CAA0C;AAC1C,sCAAqC;AACrC,sCAAsC;AACtC,mDAAgD;AAChD,6BAA4B;AAC5B,sCAAqC;AACrC,oCAAmC;AAEnC,MAAM,SAAS,GAAG,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,SAAS,EAAC,6BAA6B,CAAC,CAAC,CAAA;AAE7E,MAAM,WAAW,GAAG,CAAO,GAAG,EAAE,GAAG,EAAE,EAAE;IACtC,MAAM,YAAY,GAAG,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC;IAEpC,IAAI,CAAC,YAAY,EAAE;QAClB,OAAO,cAAc,CAAC,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AAgB,CAAC,EAAE,IAAI,EAAC,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,CAAC,CAAA;AAC1D,CAAC,CAAA,CAAA;AA4BC,wCAAc;AA1BhB,MAAM,YAAY,GAAG,CAAO,GAAG,EAAE,GAAG,EAAE,EAAE;IACvC,MAAM,OAAO,GAAG,GAAG,CAAC,MAAM,CAAC,OAAO,CAAC;IAEnC,MAAM,KAAK,GAAG,MAAM,eAAM,CAAC,OAAO,CAAC,OAAO,CAAC,EAAE,KAAK,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE,EAAC,CAAC,CAAA;IAEvE,eAAM,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,EAAE;QACrC,KAAK,EAAE;YACL,MAAM,EAAE;gBACT,CAAC,cAAE,CAAC,EAAE,CAAC,EAAE,KAAK,CAAC,EAAE;aACf;YACD,MAAM,EAAE,OAAO;SAChB;KACD,CAAC,CAAC;IAEH,aAAO,CAAC,GAAG,EAAE,EAAE,CAAC,CAAA;AACjB,CAAC,CAAA,CAAA;AAaC,oCAAY;AAXd,MAAM,aAAa,GAAG,CAAC,GAAG,EAAE,GAAG,EAAE,EAAE;IAClC,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;AAMC,sCAAa"} \ No newline at end of file diff --git a/dist/api/models/ts/timer.js b/dist/api/models/ts/timer.js index c1ac0cd..f534b4d 100644 --- a/dist/api/models/ts/timer.js +++ b/dist/api/models/ts/timer.js @@ -21,6 +21,10 @@ __decorate([ }), __metadata("design:type", Number) ], Timer.prototype, "id", void 0); +__decorate([ + sequelize_typescript_1.Column(sequelize_typescript_1.DataType.BIGINT), + __metadata("design:type", Number) +], Timer.prototype, "chatId", void 0); __decorate([ sequelize_typescript_1.Column(sequelize_typescript_1.DataType.BIGINT), __metadata("design:type", Number) diff --git a/dist/api/models/ts/timer.js.map b/dist/api/models/ts/timer.js.map index 6c3530a..27b4d2b 100644 --- a/dist/api/models/ts/timer.js.map +++ b/dist/api/models/ts/timer.js.map @@ -1 +1 @@ -{"version":3,"file":"timer.js","sourceRoot":"","sources":["../../../../api/models/ts/timer.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,+DAAsE;AAGtE,IAAqB,KAAK,GAA1B,MAAqB,KAAM,SAAQ,4BAAY;CAmB9C,CAAA;AAXC;IANC,6BAAM,CAAC;QACN,IAAI,EAAE,+BAAQ,CAAC,MAAM;QACrB,UAAU,EAAE,IAAI;QAChB,MAAM,EAAE,IAAI;QACZ,aAAa,EAAE,IAAI;KACpB,CAAC;;iCACQ;AAGV;IADC,6BAAM,CAAC,+BAAQ,CAAC,MAAM,CAAC;;qCACV;AAGd;IADC,6BAAM,CAAC,+BAAQ,CAAC,MAAM,CAAC;;uCACR;AAGhB;IADC,6BAAM,CAAC,+BAAQ,CAAC,OAAO,CAAC;;qCACX;AAjBK,KAAK;IADzB,4BAAK,CAAC,EAAC,SAAS,EAAE,eAAe,EAAE,WAAW,EAAE,IAAI,EAAC,CAAC;GAClC,KAAK,CAmBzB;kBAnBoB,KAAK"} \ No newline at end of file +{"version":3,"file":"timer.js","sourceRoot":"","sources":["../../../../api/models/ts/timer.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,+DAAsE;AAGtE,IAAqB,KAAK,GAA1B,MAAqB,KAAM,SAAQ,4BAAY;CAsB9C,CAAA;AAdC;IANC,6BAAM,CAAC;QACN,IAAI,EAAE,+BAAQ,CAAC,MAAM;QACrB,UAAU,EAAE,IAAI;QAChB,MAAM,EAAE,IAAI;QACZ,aAAa,EAAE,IAAI;KACpB,CAAC;;iCACQ;AAGV;IADC,6BAAM,CAAC,+BAAQ,CAAC,MAAM,CAAC;;qCACV;AAGd;IADC,6BAAM,CAAC,+BAAQ,CAAC,MAAM,CAAC;;qCACV;AAGd;IADC,6BAAM,CAAC,+BAAQ,CAAC,MAAM,CAAC;;uCACR;AAGhB;IADC,6BAAM,CAAC,+BAAQ,CAAC,OAAO,CAAC;;qCACX;AApBK,KAAK;IADzB,4BAAK,CAAC,EAAC,SAAS,EAAE,eAAe,EAAE,WAAW,EAAE,IAAI,EAAC,CAAC;GAClC,KAAK,CAsBzB;kBAtBoB,KAAK"} \ No newline at end of file diff --git a/dist/api/network/send.js b/dist/api/network/send.js index 5a540aa..e2dee82 100644 --- a/dist/api/network/send.js +++ b/dist/api/network/send.js @@ -18,8 +18,7 @@ const constants = require(path.join(__dirname, '../../config/constants.json')); function sendMessage(params) { return __awaiter(this, void 0, void 0, function* () { const { type, chat, message, sender, amount, success, failure, skipPubKey } = params; - const m = newmsg(type, chat, sender, message); - let msg = m; + let msg = newmsg(type, chat, sender, message); // console.log(type,message) if (!(sender && sender.publicKey)) { console.log("NO SENDER?????"); @@ -38,9 +37,9 @@ function sendMessage(params) { let isTribeOwner = false; const chatUUID = chat.uuid; if (isTribe) { - if (type === constants.message_types.confirmation) { - return; // dont send confs for tribe - } + // if(type===constants.message_types.confirmation) { + // return // dont send confs for tribe + // } console.log("is tribe!"); const tribeOwnerPubKey = chat.ownerPubkey; if (sender.publicKey === tribeOwnerPubKey) { diff --git a/dist/api/network/send.js.map b/dist/api/network/send.js.map index f7de7fc..277c81f 100644 --- a/dist/api/network/send.js.map +++ b/dist/api/network/send.js.map @@ -1 +1 @@ -{"version":3,"file":"send.js","sourceRoot":"","sources":["../../../api/network/send.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,sCAAkC;AAClC,0CAAyC;AACzC,sCAA+D;AAC/D,6BAA4B;AAC5B,0CAAyC;AAEzC,MAAM,SAAS,GAAG,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,SAAS,EAAC,6BAA6B,CAAC,CAAC,CAAA;AAI7E,SAAsB,WAAW,CAAC,MAAM;;QACvC,MAAM,EAAE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IAAI,CAAC,QAAQ,EAAE,GAC/D,CAAC,eAAe,IAAE,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,IAAI,EAAE,IAAI,CAAC,IAAI,EAAE,CACtD;QACD,OAAO,EAAE,OAAO;QAChB,MAAM,gCACL,OAAO,EAAE,MAAM,CAAC,SAAS,IACtB,YAAY,IAAI,EAAC,KAAK,EAAE,MAAM,CAAC,KAAK,EAAC,GACrC,eAAe,IAAI,EAAC,SAAS,EAAE,MAAM,CAAC,QAAQ,EAAC,CAElD;KACD,CAAA;AACF,CAAC;AAtBD,wBAsBC;AAED,SAAe,YAAY,CAAC,KAAK,EAAE,QAAQ;;QAC1C,KAAK,IAAI,KAAK,GAAG,CAAC,EAAE,KAAK,GAAG,KAAK,CAAC,MAAM,EAAE,KAAK,EAAE,EAAE;YAChD,MAAM,QAAQ,CAAC,KAAK,CAAC,KAAK,CAAC,EAAE,KAAK,EAAE,KAAK,CAAC,CAAC;SAC7C;IACF,CAAC;CAAA;AACD,SAAe,KAAK,CAAC,EAAE;;QACtB,OAAO,IAAI,OAAO,CAAC,OAAO,CAAC,EAAE,CAAC,UAAU,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC,CAAA;IACvD,CAAC;CAAA;AAED,oCAAoC;AACpC,iGAAiG;AACjG,IAAI;AACJ,oCAAoC;AACpC,yFAAyF;AACzF,IAAI"} \ No newline at end of file diff --git a/dist/api/utils/setup.js b/dist/api/utils/setup.js index 044b61a..e3ffd24 100644 --- a/dist/api/utils/setup.js +++ b/dist/api/utils/setup.js @@ -48,9 +48,11 @@ function migrate() { yield models_1.sequelize.query(` CREATE TABLE sphinx_timers ( id BIGINT, + chat_id BIGINT, receiver BIGINT, millis BIGINT, - amount DECIMAL + amount DECIMAL, + ref BIGINT )`); } catch (e) { diff --git a/dist/api/utils/setup.js.map b/dist/api/utils/setup.js.map index 0e66b4f..39f0577 100644 --- a/dist/api/utils/setup.js.map +++ b/dist/api/utils/setup.js.map @@ -1 +1 @@ -{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AAE,EAAE;YACN,IAAI;gBACF,SAAS,GAAG,MAAM,QAAQ,CAAC,EAAE,EAAE,CAAA;aAChC;YAAC,OAAM,CAAC,EAAC,GAAE;SACb;aAAM;YACL,SAAS,GAAG,EAAE,CAAA;SACf;QACD,IAAG,CAAC,SAAS,EAAE;YACb,OAAO,CAAC,GAAG,CAAC,0BAA0B,CAAC,CAAA;YACvC,OAAM;SACP;QACD,IAAI,KAAK,GAAG,SAAS,CAAA;QACrB,qDAAqD;QAErD,MAAM,GAAG,GAAG,MAAM,CAAC,IAAI,CAAC,OAAO,KAAK,KAAK,kBAAQ,IAAE,EAAE,EAAE,CAAC,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAA;QAC3E,OAAO,CAAC,GAAG,CAAC,6BAA6B,CAAC,CAAA;QAC1C,OAAO,CAAC,GAAG,CAAC,GAAG,CAAC,CAAA;QAChB,MAAM,CAAC,QAAQ,CAAC,GAAG,EAAC,EAAC,IAAI,EAAC,UAAU,EAAC,EAAE,UAAU,GAAG,EAAE,GAAG;YACvD,OAAO,CAAC,GAAG,CAAC,GAAG,CAAC,CAAA;QAClB,CAAC,CAAC,CAAA;IACJ,CAAC;CAAA"} \ No newline at end of file diff --git a/dist/api/utils/timers.js b/dist/api/utils/timers.js index df00729..729552f 100644 --- a/dist/api/utils/timers.js +++ b/dist/api/utils/timers.js @@ -11,6 +11,8 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge Object.defineProperty(exports, "__esModule", { value: true }); const models_1 = require("../models"); const network = require("../network"); +const path = require("path"); +const constants = require(path.join(__dirname, '../../config/constants.json')); function addTimer({ amount, millis, receiver }) { return __awaiter(this, void 0, void 0, function* () { const now = new Date().valueOf(); @@ -47,14 +49,18 @@ exports.reloadTimers = reloadTimers; function payBack(t) { return __awaiter(this, void 0, void 0, function* () { console.log("PAY BACK"); - const contact = yield models_1.models.Contact.findOne({ where: { id: t.receiver } }); - if (contact) { - console.log("SEND ", t.amount, "TO", contact.publicKey); - network.signAndSend({ - amt: t.amount, - dest: contact.publicKey, - }); - } + const chat = yield models_1.models.Chat.findOne({ where: { id: t.chatId } }); + const owner = yield models_1.models.Contact.findOne({ where: { isOwner: true } }); + if (!chat) + return; + const theChat = Object.assign(Object.assign({}, chat.dataValues), { contactIds: [t.receiver] }); + network.sendMessage({ + chat: theChat, + sender: owner, + message: { id: t.ref }, + amount: t.amount, + type: constants.message_types.confirmation, + }); models_1.models.Timer.destroy({ where: { id: t.id } }); }); } diff --git a/dist/api/utils/timers.js.map b/dist/api/utils/timers.js.map index ea9a3d9..8badf98 100644 --- a/dist/api/utils/timers.js.map +++ b/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;AAErC,SAAsB,QAAQ,CAAC,EAAC,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAC;;QACrD,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;SAChC,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,EAAE,EAAE;IACvC,MAAM,GAAG,GAAG,IAAI,IAAI,EAAE,CAAC,OAAO,EAAE,CAAA;IAChC,MAAM,EAAE,GAAG,IAAI,GAAC,GAAG,CAAA;IACnB,IAAG,EAAE,GAAC,CAAC;QAAE,EAAE,EAAE,CAAA,CAAC,wCAAwC;;QACjD,UAAU,CAAC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