feat: add second_brain_url when creating a tribe

This commit is contained in:
Oluwatobi Bamidele 2024-03-19 18:57:44 +01:00
parent 205a0fa455
commit 5a7b191db1
6 changed files with 12 additions and 7 deletions

View file

@ -843,7 +843,7 @@ exports.replayChatHistory = replayChatHistory;
* @param {Object} [profile_filters] - The profile filters for the chat.
* @returns {Promise<Object>} - An object containing the tribe chat parameters.
*/
function createTribeChatParams(owner, contactIds, name, img, price_per_message, price_to_join, escrow_amount, escrow_millis, unlisted, is_private, app_url, feed_url, feed_type, tenant, pin, profile_filters, call_recording, meme_server_location, jitsi_server, stakwork_api_key, stakwork_webhook) {
function createTribeChatParams(owner, contactIds, name, img, price_per_message, price_to_join, escrow_amount, escrow_millis, unlisted, is_private, app_url, feed_url, feed_type, tenant, pin, profile_filters, call_recording, meme_server_location, jitsi_server, stakwork_api_key, stakwork_webhook, second_brain_url) {
return __awaiter(this, void 0, void 0, function* () {
const date = new Date();
date.setMilliseconds(0);
@ -885,6 +885,7 @@ function createTribeChatParams(owner, contactIds, name, img, price_per_message,
jitsiServer: jitsi_server || '',
stakworkApiKey: stakwork_api_key || '',
stakworkWebhook: stakwork_webhook || '',
secondBrainUrl: second_brain_url || '',
};
});
}

File diff suppressed because one or more lines are too long

View file

@ -261,7 +261,7 @@ function createGroupChat(req, res) {
if (!req.owner)
return (0, res_1.failure)(res, 'no owner');
const tenant = req.owner.id;
const { name, is_tribe, price_per_message, price_to_join, escrow_amount, escrow_millis, img, description, tags, unlisted, app_url, feed_url, feed_type, pin, call_recording, meme_server_location, jitsi_server, stakwork_api_key, stakwork_webhook, } = req.body;
const { name, is_tribe, price_per_message, price_to_join, escrow_amount, escrow_millis, img, description, tags, unlisted, app_url, feed_url, feed_type, pin, call_recording, meme_server_location, jitsi_server, stakwork_api_key, stakwork_webhook, second_brain_url, } = req.body;
let { profile_filters } = req.body;
if (profile_filters) {
if (!Array.isArray(profile_filters)) {
@ -300,7 +300,7 @@ function createGroupChat(req, res) {
let chatParams;
let okToCreate = true;
if (is_tribe) {
chatParams = (yield (0, chatTribes_1.createTribeChatParams)(owner, contact_ids, name, img, price_per_message, price_to_join, escrow_amount, escrow_millis, unlisted, req.body.private, app_url, feed_url, feed_type, tenant, pin, profile_filters || '', call_recording, meme_server_location, jitsi_server, stakwork_api_key, stakwork_webhook));
chatParams = (yield (0, chatTribes_1.createTribeChatParams)(owner, contact_ids, name, img, price_per_message, price_to_join, escrow_amount, escrow_millis, unlisted, req.body.private, app_url, feed_url, feed_type, tenant, pin, profile_filters || '', call_recording, meme_server_location, jitsi_server, stakwork_api_key, stakwork_webhook, second_brain_url));
if (chatParams.uuid) {
// publish to tribe server
try {

File diff suppressed because one or more lines are too long

View file

@ -945,7 +945,8 @@ export async function createTribeChatParams(
meme_server_location: string,
jitsi_server: string,
stakwork_api_key: string,
stakwork_webhook: string
stakwork_webhook: string,
second_brain_url: string
): Promise<{ [k: string]: any }> {
const date = new Date()
date.setMilliseconds(0)
@ -988,6 +989,7 @@ export async function createTribeChatParams(
jitsiServer: jitsi_server || '',
stakworkApiKey: stakwork_api_key || '',
stakworkWebhook: stakwork_webhook || '',
secondBrainUrl: second_brain_url || '',
}
}

View file

@ -289,6 +289,7 @@ export async function createGroupChat(req: Req, res: Res): Promise<void> {
jitsi_server,
stakwork_api_key,
stakwork_webhook,
second_brain_url,
} = req.body
let { profile_filters } = req.body
@ -353,7 +354,8 @@ export async function createGroupChat(req: Req, res: Res): Promise<void> {
meme_server_location,
jitsi_server,
stakwork_api_key,
stakwork_webhook
stakwork_webhook,
second_brain_url
)) as Chat
if (chatParams.uuid) {
// publish to tribe server