|
@ -194,7 +194,7 @@ exports.deleteChat = deleteChat; |
|
|
function joinTribe(req, res) { |
|
|
function joinTribe(req, res) { |
|
|
return __awaiter(this, void 0, void 0, function* () { |
|
|
return __awaiter(this, void 0, void 0, function* () { |
|
|
console.log('=> joinTribe'); |
|
|
console.log('=> joinTribe'); |
|
|
const { uuid, group_key, name, host } = req.body; |
|
|
const { uuid, group_key, name, host, amount } = req.body; |
|
|
const existing = yield models_1.models.Chat.findOne({ where: { uuid } }); |
|
|
const existing = yield models_1.models.Chat.findOne({ where: { uuid } }); |
|
|
if (existing) { |
|
|
if (existing) { |
|
|
console.log('[tribes] u are already in this group'); |
|
|
console.log('[tribes] u are already in this group'); |
|
@ -232,6 +232,7 @@ function joinTribe(req, res) { |
|
|
host: host || tribes.getHost(), |
|
|
host: host || tribes.getHost(), |
|
|
groupKey: group_key, |
|
|
groupKey: group_key, |
|
|
}; |
|
|
}; |
|
|
|
|
|
console.log("JOIN TRIBE AMOUNT", amount); |
|
|
network.sendMessage({ |
|
|
network.sendMessage({ |
|
|
chat: Object.assign(Object.assign({}, chatParams), { members: { |
|
|
chat: Object.assign(Object.assign({}, chatParams), { members: { |
|
|
[owner.publicKey]: { |
|
|
[owner.publicKey]: { |
|
@ -239,6 +240,7 @@ function joinTribe(req, res) { |
|
|
alias: owner.alias || '' |
|
|
alias: owner.alias || '' |
|
|
} |
|
|
} |
|
|
} }), |
|
|
} }), |
|
|
|
|
|
amount: amount || 0, |
|
|
sender: owner, |
|
|
sender: owner, |
|
|
message: {}, |
|
|
message: {}, |
|
|
type: constants.message_types.group_join, |
|
|
type: constants.message_types.group_join, |
|
|