|
@ -155,7 +155,7 @@ exports.sendMessage = (req, res) => __awaiter(void 0, void 0, void 0, function* |
|
|
// IF BOOST AND TRIBE OWNER NEED TO SEND ACTUAL SATS TO OG POSTER
|
|
|
// IF BOOST AND TRIBE OWNER NEED TO SEND ACTUAL SATS TO OG POSTER
|
|
|
const isTribe = chat.type === constants_1.default.chat_types.tribe; |
|
|
const isTribe = chat.type === constants_1.default.chat_types.tribe; |
|
|
const isTribeOwner = isTribe && owner.publicKey === chat.ownerPubkey; |
|
|
const isTribeOwner = isTribe && owner.publicKey === chat.ownerPubkey; |
|
|
if ((!isTribe || isTribeOwner) && reply_uuid && boost && amount) { |
|
|
if (isTribeOwner && reply_uuid && boost && amount) { |
|
|
const ogMsg = yield models_1.models.Message.findOne({ where: { |
|
|
const ogMsg = yield models_1.models.Message.findOne({ where: { |
|
|
uuid: reply_uuid, |
|
|
uuid: reply_uuid, |
|
|
} }); |
|
|
} }); |
|
@ -177,14 +177,13 @@ exports.sendMessage = (req, res) => __awaiter(void 0, void 0, void 0, function* |
|
|
status: constants_1.default.statuses.pending, |
|
|
status: constants_1.default.statuses.pending, |
|
|
createdAt: date, |
|
|
createdAt: date, |
|
|
updatedAt: date, |
|
|
updatedAt: date, |
|
|
network_type: realSatsContactId ? |
|
|
network_type: (!isTribe || realSatsContactId) ? |
|
|
constants_1.default.network_types.lightning : |
|
|
constants_1.default.network_types.lightning : |
|
|
constants_1.default.network_types.mqtt |
|
|
constants_1.default.network_types.mqtt |
|
|
}; |
|
|
}; |
|
|
if (reply_uuid) |
|
|
if (reply_uuid) |
|
|
msg.replyUuid = reply_uuid; |
|
|
msg.replyUuid = reply_uuid; |
|
|
// console.log(msg)
|
|
|
// console.log(msg)
|
|
|
console.log("=> SAVED MSG", JSON.stringify(msg, null, 2)); |
|
|
|
|
|
const message = yield models_1.models.Message.create(msg); |
|
|
const message = yield models_1.models.Message.create(msg); |
|
|
res_1.success(res, jsonUtils.messageToJson(message, chat)); |
|
|
res_1.success(res, jsonUtils.messageToJson(message, chat)); |
|
|
const msgToSend = { |
|
|
const msgToSend = { |
|
|