Browse Source

amtToStore as boost as admin

dependabot/npm_and_yarn/ini-1.3.7
Evan Feenstra 4 years ago
parent
commit
48be5bf135
  1. 5
      dist/src/controllers/messages.js
  2. 2
      dist/src/controllers/messages.js.map
  3. 6
      src/controllers/messages.ts

5
dist/src/controllers/messages.js

@ -154,7 +154,7 @@ exports.sendMessage = (req, res) => __awaiter(void 0, void 0, void 0, function*
let realSatsContactId;
// IF BOOST NEED TO SEND ACTUAL SATS TO OG POSTER
const isTribe = chat.type === constants_1.default.chat_types.tribe;
// const isTribeOwner = owner.publicKey===chat.owner_pubkey
const isTribeOwner = owner.publicKey === chat.owner_pubkey;
if (reply_uuid && boost && amount) {
const ogMsg = yield models_1.models.Message.findOne({ where: {
uuid: reply_uuid,
@ -208,6 +208,9 @@ exports.sendMessage = (req, res) => __awaiter(void 0, void 0, void 0, function*
};
if (realSatsContactId)
sendMessageParams.realSatsContactId = realSatsContactId;
if (realSatsContactId && isTribeOwner && amtToStore) {
sendMessageParams.amount = amtToStore;
}
// final send
network.sendMessage(sendMessageParams);
});

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

File diff suppressed because one or more lines are too long

6
src/controllers/messages.ts

@ -177,7 +177,7 @@ export const sendMessage = async (req, res) => {
let realSatsContactId
// IF BOOST NEED TO SEND ACTUAL SATS TO OG POSTER
const isTribe = chat.type===constants.chat_types.tribe
// const isTribeOwner = owner.publicKey===chat.owner_pubkey
const isTribeOwner = owner.publicKey===chat.owner_pubkey
if(reply_uuid && boost && amount) {
const ogMsg = await models.Message.findOne({where:{
uuid: reply_uuid,
@ -233,7 +233,9 @@ export const sendMessage = async (req, res) => {
message: msgToSend,
}
if(realSatsContactId) sendMessageParams.realSatsContactId = realSatsContactId
if(realSatsContactId && isTribeOwner && amtToStore) {
sendMessageParams.amount = amtToStore
}
// final send
network.sendMessage(sendMessageParams)
}

Loading…
Cancel
Save