Browse Source

Merge pull request #45 from stakwork/attach-amount

fix-attachment-amount
feature/dockerfile-arm v0.9.11
Evan Feenstra 5 years ago
committed by GitHub
parent
commit
1b5b2ca415
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 3
      api/controllers/media.ts
  2. 4
      dist/api/controllers/media.js
  3. 2
      dist/api/controllers/media.js.map

3
api/controllers/media.ts

@ -55,6 +55,7 @@ const sendAttachmentMessage = async (req, res) => {
remote_text_map,
media_key_map,
media_type,
amount,
file_name,
ttl,
price, // IF AMOUNT>0 THEN do NOT sign or send receipt
@ -96,6 +97,7 @@ const sendAttachmentMessage = async (req, res) => {
sender: owner.id,
type: constants.message_types.attachment,
status: constants.statuses.pending,
amount: amount||0,
messageContent: text||file_name||'',
remoteMessageContent,
mediaToken: myMediaToken,
@ -125,6 +127,7 @@ const sendAttachmentMessage = async (req, res) => {
chat: chat,
sender: owner,
type: constants.message_types.attachment,
amount: amount||0,
message: msg,
success: async (data) => {
console.log('attachment sent', { data })

4
dist/api/controllers/media.js

@ -53,7 +53,7 @@ const sendAttachmentMessage = (req, res) => __awaiter(void 0, void 0, void 0, fu
// } catch(e) {
// return resUtils.failure(res, e.message)
// }
const { chat_id, contact_id, muid, text, remote_text, remote_text_map, media_key_map, media_type, file_name, ttl, price, } = req.body;
const { chat_id, contact_id, muid, text, remote_text, remote_text_map, media_key_map, media_type, amount, file_name, ttl, price, } = req.body;
console.log('[send attachment]', req.body);
const owner = yield models_1.models.Contact.findOne({ where: { isOwner: true } });
const chat = yield helpers.findOrCreateChat({
@ -86,6 +86,7 @@ const sendAttachmentMessage = (req, res) => __awaiter(void 0, void 0, void 0, fu
sender: owner.id,
type: constants.message_types.attachment,
status: constants.statuses.pending,
amount: amount || 0,
messageContent: text || file_name || '',
remoteMessageContent,
mediaToken: myMediaToken,
@ -113,6 +114,7 @@ const sendAttachmentMessage = (req, res) => __awaiter(void 0, void 0, void 0, fu
chat: chat,
sender: owner,
type: constants.message_types.attachment,
amount: amount || 0,
message: msg,
success: (data) => __awaiter(void 0, void 0, void 0, function* () {
console.log('attachment sent', { data });

2
dist/api/controllers/media.js.map

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