Browse Source

purhcase->attachemnt

feature/dockerfile-arm
Evan Feenstra 4 years ago
parent
commit
b95ca49d0e
  1. 6
      api/network/modify.ts
  2. 6
      dist/api/network/modify.js
  3. 2
      dist/api/network/modify.js.map

6
api/network/modify.ts

@ -104,11 +104,11 @@ export async function sendFinalMemeIfFirstPurchaser(payload, chat, sender){
const existingMediaKey = await models.MediaKey.findOne({where:{muid}}) const existingMediaKey = await models.MediaKey.findOne({where:{muid}})
if(existingMediaKey) return // no need, its already been sent if(existingMediaKey) return // no need, its already been sent
console.log("DOWNLOAD AND REIP:OAD") console.log("DOWNLOAD AND REIP:OAD",mt)
const termsAndKey = await downloadAndUploadAndSaveReturningTermsAndKey(payload,chat,sender) const termsAndKey = await downloadAndUploadAndSaveReturningTermsAndKey(payload,chat,sender)
const msg = await models.Message.findOne({where:{mediaToken:mt,type:msgtypes.purchase}}) const msg = await models.Message.findOne({where:{mediaToken:mt,type:msgtypes.attachment}})
console.log("OG MSG",msg.dataValues) console.log("OG MSG",msg.dataValues) // not found
const ogSender = await models.Contact.findOne({where:{id:msg.sender}}) const ogSender = await models.Contact.findOne({where:{id:msg.sender}})
console.log("OG SENDER",ogSender.dataValues) console.log("OG SENDER",ogSender.dataValues)
// find "purchase" Message with the OG muid // find "purchase" Message with the OG muid

6
dist/api/network/modify.js

@ -113,10 +113,10 @@ function sendFinalMemeIfFirstPurchaser(payload, chat, sender) {
const existingMediaKey = yield models_1.models.MediaKey.findOne({ where: { muid } }); const existingMediaKey = yield models_1.models.MediaKey.findOne({ where: { muid } });
if (existingMediaKey) if (existingMediaKey)
return; // no need, its already been sent return; // no need, its already been sent
console.log("DOWNLOAD AND REIP:OAD"); console.log("DOWNLOAD AND REIP:OAD", mt);
const termsAndKey = yield downloadAndUploadAndSaveReturningTermsAndKey(payload, chat, sender); const termsAndKey = yield downloadAndUploadAndSaveReturningTermsAndKey(payload, chat, sender);
const msg = yield models_1.models.Message.findOne({ where: { mediaToken: mt, type: msgtypes.purchase } }); const msg = yield models_1.models.Message.findOne({ where: { mediaToken: mt, type: msgtypes.attachment } });
console.log("OG MSG", msg.dataValues); console.log("OG MSG", msg.dataValues); // not found
const ogSender = yield models_1.models.Contact.findOne({ where: { id: msg.sender } }); const ogSender = yield models_1.models.Contact.findOne({ where: { id: msg.sender } });
console.log("OG SENDER", ogSender.dataValues); console.log("OG SENDER", ogSender.dataValues);
// find "purchase" Message with the OG muid // find "purchase" Message with the OG muid

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

File diff suppressed because one or more lines are too long
Loading…
Cancel
Save