|
@ -48,6 +48,7 @@ function purchaseFromOriginalSender(payload, chat, purchaser) { |
|
|
if (!muid) |
|
|
if (!muid) |
|
|
return; |
|
|
return; |
|
|
const mediaKey = yield models_1.models.MediaKey.findOne({ where: { originalMuid: muid } }); |
|
|
const mediaKey = yield models_1.models.MediaKey.findOne({ where: { originalMuid: muid } }); |
|
|
|
|
|
console.log("MEDIA KEY FOUND", mediaKey.dataValues); |
|
|
const terms = ldat_1.parseLDAT(mt); |
|
|
const terms = ldat_1.parseLDAT(mt); |
|
|
let price = terms.meta && terms.meta.amt; |
|
|
let price = terms.meta && terms.meta.amt; |
|
|
if (amount < price) |
|
|
if (amount < price) |
|
@ -66,6 +67,7 @@ function purchaseFromOriginalSender(payload, chat, purchaser) { |
|
|
originalMuid: mediaKey.originalMuid, |
|
|
originalMuid: mediaKey.originalMuid, |
|
|
mediaType: mediaKey.mediaType |
|
|
mediaType: mediaKey.mediaType |
|
|
}; |
|
|
}; |
|
|
|
|
|
console.log('send the thingy'); |
|
|
send_1.sendMessage({ |
|
|
send_1.sendMessage({ |
|
|
chat: Object.assign(Object.assign({}, chat.dataValues), { contactIds: [mediaKey.sender] }), |
|
|
chat: Object.assign(Object.assign({}, chat.dataValues), { contactIds: [mediaKey.sender] }), |
|
|
sender: owner, |
|
|
sender: owner, |
|
@ -75,6 +77,7 @@ function purchaseFromOriginalSender(payload, chat, purchaser) { |
|
|
failure: () => { } |
|
|
failure: () => { } |
|
|
}); |
|
|
}); |
|
|
// PAY THE OG POSTER HERE!!!
|
|
|
// PAY THE OG POSTER HERE!!!
|
|
|
|
|
|
console.log('pay the dude'); |
|
|
send_1.sendMessage({ |
|
|
send_1.sendMessage({ |
|
|
chat: Object.assign(Object.assign({}, chat.dataValues), { contactIds: [purchaser.id] }), |
|
|
chat: Object.assign(Object.assign({}, chat.dataValues), { contactIds: [purchaser.id] }), |
|
|
sender: owner, |
|
|
sender: owner, |
|
|