Browse Source

store the amount sent in the member_request as the price_to_join used in final group_join

push-params
Evan Feenstra 5 years ago
parent
commit
1c33341698
  1. 6
      api/controllers/chatTribes.ts
  2. 6
      dist/api/controllers/chatTribes.js
  3. 2
      dist/api/controllers/chatTribes.js.map
  4. 2
      dist/api/network/receive.js
  5. 2
      dist/api/network/receive.js.map

6
api/controllers/chatTribes.ts

@ -70,7 +70,8 @@ export async function joinTribe(req, res){
groupKey: group_key,
ownerPubkey: owner_pubkey,
private: is_private||false,
status: chatStatus
status: chatStatus,
priceToJoin: amount||0,
}
const typeToSend = is_private ?
@ -308,6 +309,7 @@ export async function receiveMemberApprove(payload) {
}
})
const amount = chat.priceToJoin||0
const theChat = chat.dataValues||chat
// send JOIN and my info to all
network.sendMessage({
@ -319,7 +321,7 @@ export async function receiveMemberApprove(payload) {
}
}
},
amount:0,
amount,
sender: owner,
message: {},
type: constants.message_types.group_join,

6
dist/api/controllers/chatTribes.js

@ -75,7 +75,8 @@ function joinTribe(req, res) {
groupKey: group_key,
ownerPubkey: owner_pubkey,
private: is_private || false,
status: chatStatus
status: chatStatus,
priceToJoin: amount || 0,
};
const typeToSend = is_private ?
constants.message_types.member_request :
@ -297,6 +298,7 @@ function receiveMemberApprove(payload) {
message: jsonUtils.messageToJson(message, null)
}
});
const amount = chat.priceToJoin || 0;
const theChat = chat.dataValues || chat;
// send JOIN and my info to all
network.sendMessage({
@ -306,7 +308,7 @@ function receiveMemberApprove(payload) {
alias: owner.alias || ''
}
} }),
amount: 0,
amount,
sender: owner,
message: {},
type: constants.message_types.group_join,

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

File diff suppressed because one or more lines are too long

2
dist/api/network/receive.js

@ -43,7 +43,7 @@ exports.typesToReplay = [
];
function onReceive(payload) {
return __awaiter(this, void 0, void 0, function* () {
// console.log("ON RECEIVE",payload)
console.log("=> ON RECEIVE", payload);
// if tribe, owner must forward to MQTT
let doAction = true;
const toAddIn = {};

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

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