mirror of
https://github.com/stakwork/sphinx-relay.git
synced 2026-08-13 12:33:24 +02:00
Compare commits
23 commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ebcc2e0703 | ||
|
|
f879688d62 | ||
|
|
92a66aa3d4 | ||
|
|
332923b13b | ||
|
|
63d82c88c3 | ||
|
|
3843f44199 | ||
|
|
d190bd85f2 | ||
|
|
78cd8a0548 | ||
|
|
3330338f4a | ||
|
|
6970098eb9 | ||
|
|
3dc5029c37 | ||
|
|
c0962f5f27 | ||
|
|
48d023e96b | ||
|
|
f54d2f5bbb | ||
|
|
57f77c5884 | ||
|
|
50272a7d7e | ||
|
|
7bf43c4a49 | ||
|
|
9dfaff50ff | ||
|
|
e27d93257c | ||
|
|
36d4ebf010 | ||
|
|
d16c1de085 | ||
|
|
ca62559eca | ||
|
|
ee4299692e |
19 changed files with 114 additions and 45 deletions
6
app.ts
6
app.ts
|
|
@ -5,7 +5,7 @@ import * as cors from 'cors'
|
|||
import * as https from 'https'
|
||||
import * as http from 'http'
|
||||
import logger, { logging, sphinxLogger } from './src/utils/logger'
|
||||
import { pingHubInterval, checkInvitesHubInterval } from './src/hub'
|
||||
import { checkInvitesHubInterval } from './src/hub'
|
||||
import { genUsersInterval } from './src/utils/proxy'
|
||||
import {
|
||||
setupDatabase,
|
||||
|
|
@ -47,7 +47,7 @@ async function start() {
|
|||
mainSetup()
|
||||
// // IF NOT UNLOCK, go ahead and start this now
|
||||
if (config.hub_api_url && !config.unlock) {
|
||||
pingHubInterval(30000)
|
||||
//pingHubInterval(30000)
|
||||
genUsersInterval(60000)
|
||||
}
|
||||
}
|
||||
|
|
@ -73,7 +73,7 @@ async function finishSetup() {
|
|||
}
|
||||
if (config.unlock) {
|
||||
// IF UNLOCK, start this only after unlocked!
|
||||
pingHubInterval(15000)
|
||||
//pingHubInterval(15000)
|
||||
}
|
||||
leadershipBoardInterval(1800000)
|
||||
setupDone()
|
||||
|
|
|
|||
3
dist/src/builtin/kick.js
vendored
3
dist/src/builtin/kick.js
vendored
|
|
@ -168,7 +168,8 @@ function init() {
|
|||
},
|
||||
{ name: 'Help', value: '/kick help' },
|
||||
])
|
||||
.setThumbnail(botSVG);
|
||||
.setThumbnail(botSVG)
|
||||
.setOnlyOwner(true);
|
||||
message.channel.send({ embed });
|
||||
return;
|
||||
}
|
||||
|
|
|
|||
2
dist/src/builtin/kick.js.map
vendored
2
dist/src/builtin/kick.js.map
vendored
File diff suppressed because one or more lines are too long
21
dist/src/builtin/mother.js
vendored
21
dist/src/builtin/mother.js
vendored
|
|
@ -10,7 +10,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|||
});
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.init = void 0;
|
||||
exports.init = exports.adminsOnlyBot = void 0;
|
||||
// import * as SphinxBot from '../../../sphinx-bot'
|
||||
const Sphinx = require("sphinx-bot");
|
||||
const botapi_1 = require("../controllers/botapi");
|
||||
|
|
@ -79,6 +79,7 @@ const builtInBotNames = {
|
|||
spam_gone: 'SpamGoneBot',
|
||||
[`${ml_1.ML_PREFIX.substring(1)}`]: ml_1.ML_BOTNAME,
|
||||
};
|
||||
exports.adminsOnlyBot = ['kick'];
|
||||
function init() {
|
||||
const client = new Sphinx.Client();
|
||||
client.login('_', botapi_1.finalAction);
|
||||
|
|
@ -108,7 +109,8 @@ function init() {
|
|||
if (existing) {
|
||||
const embed = new Sphinx.MessageEmbed()
|
||||
.setAuthor('MotherBot')
|
||||
.setDescription(botName + ' already installed');
|
||||
.setDescription(botName + ' already installed')
|
||||
.setOnlyOwner(exports.adminsOnlyBot.includes(botName) || false);
|
||||
return message.channel.send({ embed });
|
||||
}
|
||||
const msgTypes = builtInBotMsgTypes[botName] || [
|
||||
|
|
@ -132,7 +134,8 @@ function init() {
|
|||
const theName = builtInBotNames[botName] || 'Bot';
|
||||
const embed = new Sphinx.MessageEmbed()
|
||||
.setAuthor('MotherBot')
|
||||
.setDescription(theName + ' has been installed!');
|
||||
.setDescription(theName + ' has been installed!')
|
||||
.setOnlyOwner(exports.adminsOnlyBot.includes(botName) || false);
|
||||
message.channel.send({ embed });
|
||||
}
|
||||
else {
|
||||
|
|
@ -144,7 +147,8 @@ function init() {
|
|||
if (existing) {
|
||||
const embed = new Sphinx.MessageEmbed()
|
||||
.setAuthor('MotherBot')
|
||||
.setDescription(botName + ' already installed');
|
||||
.setDescription(botName + ' already installed')
|
||||
.setOnlyOwner(exports.adminsOnlyBot.includes(botName) || false);
|
||||
return message.channel.send({ embed });
|
||||
}
|
||||
// bot from tribes registry
|
||||
|
|
@ -159,7 +163,8 @@ function init() {
|
|||
else {
|
||||
const embed = new Sphinx.MessageEmbed()
|
||||
.setAuthor('MotherBot')
|
||||
.setDescription('No bot with that name');
|
||||
.setDescription('No bot with that name')
|
||||
.setOnlyOwner(exports.adminsOnlyBot.includes(botName) || false);
|
||||
message.channel.send({ embed });
|
||||
}
|
||||
}
|
||||
|
|
@ -182,13 +187,15 @@ function init() {
|
|||
yield existing2.destroy();
|
||||
const embed = new Sphinx.MessageEmbed()
|
||||
.setAuthor('MotherBot')
|
||||
.setDescription(botName2 + ' has been removed');
|
||||
.setDescription(botName2 + ' has been removed')
|
||||
.setOnlyOwner(exports.adminsOnlyBot.includes(botName2) || false);
|
||||
return message.channel.send({ embed });
|
||||
}
|
||||
else {
|
||||
const embed = new Sphinx.MessageEmbed()
|
||||
.setAuthor('MotherBot')
|
||||
.setDescription('Cant find a bot by that name');
|
||||
.setDescription('Cant find a bot by that name')
|
||||
.setOnlyOwner(exports.adminsOnlyBot.includes(botName2) || false);
|
||||
return message.channel.send({ embed });
|
||||
}
|
||||
case 'search':
|
||||
|
|
|
|||
2
dist/src/builtin/mother.js.map
vendored
2
dist/src/builtin/mother.js.map
vendored
File diff suppressed because one or more lines are too long
7
dist/src/controllers/chatTribes.js
vendored
7
dist/src/controllers/chatTribes.js
vendored
|
|
@ -426,6 +426,7 @@ function editTribe(req, res) {
|
|||
owner_pubkey: owner.publicKey,
|
||||
pin: pin || '',
|
||||
profile_filters: profile_filters || '',
|
||||
second_brain_url,
|
||||
});
|
||||
}
|
||||
catch (e) {
|
||||
|
|
@ -448,9 +449,9 @@ function editTribe(req, res) {
|
|||
obj.escrowMillis = escrow_millis;
|
||||
if (unlisted || unlisted === false)
|
||||
obj.unlisted = unlisted;
|
||||
if (app_url)
|
||||
if (app_url || app_url === '')
|
||||
obj.appUrl = app_url;
|
||||
if (feed_url)
|
||||
if (feed_url || feed_url === '')
|
||||
obj.feedUrl = feed_url;
|
||||
if (feed_type)
|
||||
obj.feedType = feed_type;
|
||||
|
|
@ -468,7 +469,7 @@ function editTribe(req, res) {
|
|||
obj.stakworkApiKey = stakwork_api_key;
|
||||
if (stakwork_webhook)
|
||||
obj.stakworkWebhook = stakwork_webhook;
|
||||
if (second_brain_url)
|
||||
if (second_brain_url || second_brain_url === '')
|
||||
obj.secondBrainUrl = second_brain_url;
|
||||
if (Object.keys(obj).length > 0) {
|
||||
yield chat.update(obj);
|
||||
|
|
|
|||
2
dist/src/controllers/chatTribes.js.map
vendored
2
dist/src/controllers/chatTribes.js.map
vendored
File diff suppressed because one or more lines are too long
1
dist/src/controllers/chats.js
vendored
1
dist/src/controllers/chats.js
vendored
|
|
@ -326,6 +326,7 @@ function createGroupChat(req, res) {
|
|||
owner_route_hint: owner.routeHint || '',
|
||||
pin: pin || '',
|
||||
profile_filters: profile_filters || '',
|
||||
second_brain_url: second_brain_url || '',
|
||||
});
|
||||
}
|
||||
catch (e) {
|
||||
|
|
|
|||
2
dist/src/controllers/chats.js.map
vendored
2
dist/src/controllers/chats.js.map
vendored
File diff suppressed because one or more lines are too long
36
dist/src/network/send.js
vendored
36
dist/src/network/send.js
vendored
|
|
@ -21,7 +21,7 @@ const logger_1 = require("../utils/logger");
|
|||
const config_1 = require("../utils/config");
|
||||
const errMsgString_1 = require("../utils/errMsgString");
|
||||
const proxy_1 = require("../utils/proxy");
|
||||
const ml_1 = require("../builtin/ml");
|
||||
const mother_1 = require("../builtin/mother");
|
||||
const intercept = require("./intercept");
|
||||
const receive_1 = require("./receive");
|
||||
const config = (0, config_1.loadConfig)();
|
||||
|
|
@ -423,27 +423,47 @@ function compareAliases(alias1, alias2) {
|
|||
});
|
||||
return match;
|
||||
}
|
||||
function updateMessageToIsOnlyOwner(uuid, tenant) {
|
||||
return __awaiter(this, void 0, void 0, function* () {
|
||||
yield models_1.models.Message.update({
|
||||
onlyOwner: true,
|
||||
}, { where: { uuid, tenant } });
|
||||
});
|
||||
}
|
||||
function interceptTribeMsgForHiddenCmds(msg, tenant) {
|
||||
return __awaiter(this, void 0, void 0, function* () {
|
||||
const hideAllCommandsBot = ['/kick', '/ml'];
|
||||
try {
|
||||
const content = msg.message.content;
|
||||
const splitedContent = (content && content.split(' ')) || [];
|
||||
if (splitedContent.length < 1)
|
||||
return false;
|
||||
// must be a "/" bot command
|
||||
if (!splitedContent[0].startsWith('/')) {
|
||||
return false;
|
||||
}
|
||||
if (splitedContent[0] === '/bot') {
|
||||
if (mother_1.adminsOnlyBot.includes(splitedContent[2])) {
|
||||
yield updateMessageToIsOnlyOwner(msg.message.uuid, tenant);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
const newChat = (yield models_1.models.Chat.findOne({
|
||||
where: { uuid: msg.chat.uuid },
|
||||
}));
|
||||
const bots = (yield models_1.models.ChatBot.findAll({
|
||||
where: { tenant, chatId: newChat.id },
|
||||
}));
|
||||
const content = msg.message.content;
|
||||
const splitedContent = (content && content.split(' ')) || [];
|
||||
for (let i = 0; i < bots.length; i++) {
|
||||
const bot = bots[i];
|
||||
const isHidden = bot.botPrefix === splitedContent[0] &&
|
||||
bot.hiddenCommands &&
|
||||
JSON.parse(bot.hiddenCommands).includes(splitedContent[1]);
|
||||
const isPersonal = bot.botPrefix === ml_1.ML_PREFIX;
|
||||
if (isHidden || isPersonal) {
|
||||
yield models_1.models.Message.update({
|
||||
onlyOwner: true,
|
||||
}, { where: { uuid: msg.message.uuid, tenant } });
|
||||
const isDefaultHide = bot.botPrefix === splitedContent[0] &&
|
||||
hideAllCommandsBot.includes(bot.botPrefix);
|
||||
if (isHidden || isDefaultHide) {
|
||||
yield updateMessageToIsOnlyOwner(msg.message.uuid, tenant);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
2
dist/src/network/send.js.map
vendored
2
dist/src/network/send.js.map
vendored
File diff suppressed because one or more lines are too long
6
dist/src/utils/tribes.js
vendored
6
dist/src/utils/tribes.js
vendored
|
|
@ -362,7 +362,7 @@ function getTribeOwnersChatByUUID(uuid) {
|
|||
});
|
||||
}
|
||||
exports.getTribeOwnersChatByUUID = getTribeOwnersChatByUUID;
|
||||
function declare({ uuid, name, description, tags, img, group_key, host, price_per_message, price_to_join, owner_alias, owner_pubkey, escrow_amount, escrow_millis, unlisted, is_private, app_url, feed_url, feed_type, owner_route_hint, pin, profile_filters, }) {
|
||||
function declare({ uuid, name, description, tags, img, group_key, host, price_per_message, price_to_join, owner_alias, owner_pubkey, escrow_amount, escrow_millis, unlisted, is_private, app_url, feed_url, feed_type, owner_route_hint, pin, profile_filters, second_brain_url, }) {
|
||||
return __awaiter(this, void 0, void 0, function* () {
|
||||
try {
|
||||
let protocol = 'https';
|
||||
|
|
@ -391,6 +391,7 @@ function declare({ uuid, name, description, tags, img, group_key, host, price_pe
|
|||
owner_route_hint: owner_route_hint || '',
|
||||
pin: pin || '',
|
||||
profile_filters,
|
||||
second_brain_url,
|
||||
}),
|
||||
headers: { 'Content-Type': 'application/json' },
|
||||
});
|
||||
|
|
@ -406,7 +407,7 @@ function declare({ uuid, name, description, tags, img, group_key, host, price_pe
|
|||
});
|
||||
}
|
||||
exports.declare = declare;
|
||||
function edit({ uuid, host, name, description, tags, img, price_per_message, price_to_join, owner_alias, escrow_amount, escrow_millis, unlisted, is_private, app_url, feed_url, feed_type, deleted, owner_route_hint, owner_pubkey, pin, profile_filters, }) {
|
||||
function edit({ uuid, host, name, description, tags, img, price_per_message, price_to_join, owner_alias, escrow_amount, escrow_millis, unlisted, is_private, app_url, feed_url, feed_type, deleted, owner_route_hint, owner_pubkey, pin, profile_filters, second_brain_url, }) {
|
||||
return __awaiter(this, void 0, void 0, function* () {
|
||||
try {
|
||||
const token = yield genSignedTimestamp(owner_pubkey);
|
||||
|
|
@ -435,6 +436,7 @@ function edit({ uuid, host, name, description, tags, img, price_per_message, pri
|
|||
owner_route_hint: owner_route_hint || '',
|
||||
pin: pin || '',
|
||||
profile_filters,
|
||||
second_brain_url: second_brain_url || '',
|
||||
}),
|
||||
headers: { 'Content-Type': 'application/json' },
|
||||
});
|
||||
|
|
|
|||
2
dist/src/utils/tribes.js.map
vendored
2
dist/src/utils/tribes.js.map
vendored
File diff suppressed because one or more lines are too long
|
|
@ -178,6 +178,7 @@ export function init() {
|
|||
{ name: 'Help', value: '/kick help' },
|
||||
])
|
||||
.setThumbnail(botSVG)
|
||||
.setOnlyOwner(true)
|
||||
message.channel.send({ embed })
|
||||
return
|
||||
}
|
||||
|
|
|
|||
|
|
@ -75,6 +75,8 @@ const builtInBotNames = {
|
|||
[`${ML_PREFIX.substring(1)}`]: ML_BOTNAME,
|
||||
}
|
||||
|
||||
export const adminsOnlyBot = ['kick']
|
||||
|
||||
export function init() {
|
||||
const client = new Sphinx.Client()
|
||||
client.login('_', finalAction)
|
||||
|
|
@ -105,6 +107,7 @@ export function init() {
|
|||
const embed = new Sphinx.MessageEmbed()
|
||||
.setAuthor('MotherBot')
|
||||
.setDescription(botName + ' already installed')
|
||||
.setOnlyOwner(adminsOnlyBot.includes(botName) || false)
|
||||
return message.channel.send({ embed })
|
||||
}
|
||||
const msgTypes = builtInBotMsgTypes[botName] || [
|
||||
|
|
@ -129,6 +132,7 @@ export function init() {
|
|||
const embed = new Sphinx.MessageEmbed()
|
||||
.setAuthor('MotherBot')
|
||||
.setDescription(theName + ' has been installed!')
|
||||
.setOnlyOwner(adminsOnlyBot.includes(botName) || false)
|
||||
message.channel.send({ embed })
|
||||
} else {
|
||||
const chat = await getTribeOwnersChatByUUID(message.channel.id)
|
||||
|
|
@ -141,6 +145,7 @@ export function init() {
|
|||
const embed = new Sphinx.MessageEmbed()
|
||||
.setAuthor('MotherBot')
|
||||
.setDescription(botName + ' already installed')
|
||||
.setOnlyOwner(adminsOnlyBot.includes(botName) || false)
|
||||
return message.channel.send({ embed })
|
||||
}
|
||||
// bot from tribes registry
|
||||
|
|
@ -155,6 +160,7 @@ export function init() {
|
|||
const embed = new Sphinx.MessageEmbed()
|
||||
.setAuthor('MotherBot')
|
||||
.setDescription('No bot with that name')
|
||||
.setOnlyOwner(adminsOnlyBot.includes(botName) || false)
|
||||
message.channel.send({ embed })
|
||||
}
|
||||
}
|
||||
|
|
@ -178,11 +184,13 @@ export function init() {
|
|||
const embed = new Sphinx.MessageEmbed()
|
||||
.setAuthor('MotherBot')
|
||||
.setDescription(botName2 + ' has been removed')
|
||||
.setOnlyOwner(adminsOnlyBot.includes(botName2) || false)
|
||||
return message.channel.send({ embed })
|
||||
} else {
|
||||
const embed = new Sphinx.MessageEmbed()
|
||||
.setAuthor('MotherBot')
|
||||
.setDescription('Cant find a bot by that name')
|
||||
.setOnlyOwner(adminsOnlyBot.includes(botName2) || false)
|
||||
return message.channel.send({ embed })
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -474,6 +474,7 @@ export async function editTribe(req: Req, res: Res): Promise<void | Response> {
|
|||
owner_pubkey: owner.publicKey,
|
||||
pin: pin || '',
|
||||
profile_filters: profile_filters || '',
|
||||
second_brain_url,
|
||||
})
|
||||
} catch (e) {
|
||||
okToUpdate = false
|
||||
|
|
@ -490,8 +491,8 @@ export async function editTribe(req: Req, res: Res): Promise<void | Response> {
|
|||
if (escrow_amount || escrow_amount === 0) obj.escrowAmount = escrow_amount
|
||||
if (escrow_millis || escrow_millis === 0) obj.escrowMillis = escrow_millis
|
||||
if (unlisted || unlisted === false) obj.unlisted = unlisted
|
||||
if (app_url) obj.appUrl = app_url
|
||||
if (feed_url) obj.feedUrl = feed_url
|
||||
if (app_url || app_url === '') obj.appUrl = app_url
|
||||
if (feed_url || feed_url === '') obj.feedUrl = feed_url
|
||||
if (feed_type) obj.feedType = feed_type
|
||||
if (req.body.private || req.body.private === false)
|
||||
obj.private = req.body.private
|
||||
|
|
@ -502,7 +503,8 @@ export async function editTribe(req: Req, res: Res): Promise<void | Response> {
|
|||
if (jitsi_server) obj.jitsiServer = jitsi_server
|
||||
if (stakwork_api_key) obj.stakworkApiKey = stakwork_api_key
|
||||
if (stakwork_webhook) obj.stakworkWebhook = stakwork_webhook
|
||||
if (second_brain_url) obj.secondBrainUrl = second_brain_url
|
||||
if (second_brain_url || second_brain_url === '')
|
||||
obj.secondBrainUrl = second_brain_url
|
||||
if (Object.keys(obj).length > 0) {
|
||||
await chat.update(obj)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -382,6 +382,7 @@ export async function createGroupChat(req: Req, res: Res): Promise<void> {
|
|||
owner_route_hint: owner.routeHint || '',
|
||||
pin: pin || '',
|
||||
profile_filters: profile_filters || '',
|
||||
second_brain_url: second_brain_url || '',
|
||||
})
|
||||
} catch (e) {
|
||||
sphinxLogger.error(`=> couldnt create tribe ${e}`)
|
||||
|
|
|
|||
|
|
@ -22,7 +22,7 @@ import { logging, sphinxLogger } from '../utils/logger'
|
|||
import { loadConfig } from '../utils/config'
|
||||
import { errMsgString } from '../utils/errMsgString'
|
||||
import { getProxyRootPubkey, isProxy } from '../utils/proxy'
|
||||
import { ML_PREFIX } from '../builtin/ml'
|
||||
import { adminsOnlyBot } from '../builtin/mother'
|
||||
import { Msg, MessageContent, ChatMember } from './interfaces'
|
||||
import * as intercept from './intercept'
|
||||
import { typesToForward, receiveCoTenantMessage } from './receive'
|
||||
|
|
@ -543,11 +543,37 @@ function compareAliases(alias1: string, alias2: string): boolean {
|
|||
return match
|
||||
}
|
||||
|
||||
async function updateMessageToIsOnlyOwner(uuid: string, tenant: number) {
|
||||
await models.Message.update(
|
||||
{
|
||||
onlyOwner: true,
|
||||
},
|
||||
{ where: { uuid, tenant } }
|
||||
)
|
||||
}
|
||||
|
||||
async function interceptTribeMsgForHiddenCmds(
|
||||
msg: Msg,
|
||||
tenant: number
|
||||
): Promise<boolean> {
|
||||
const hideAllCommandsBot = ['/kick', '/ml']
|
||||
try {
|
||||
const content = msg.message.content as string
|
||||
|
||||
const splitedContent = (content && content.split(' ')) || []
|
||||
if (splitedContent.length < 1) return false
|
||||
// must be a "/" bot command
|
||||
if (!splitedContent[0].startsWith('/')) {
|
||||
return false
|
||||
}
|
||||
|
||||
if (splitedContent[0] === '/bot') {
|
||||
if (adminsOnlyBot.includes(splitedContent[2])) {
|
||||
await updateMessageToIsOnlyOwner(msg.message.uuid, tenant)
|
||||
return true
|
||||
}
|
||||
return false
|
||||
}
|
||||
const newChat = (await models.Chat.findOne({
|
||||
where: { uuid: msg.chat.uuid },
|
||||
})) as ChatRecord
|
||||
|
|
@ -556,8 +582,6 @@ async function interceptTribeMsgForHiddenCmds(
|
|||
where: { tenant, chatId: newChat.id },
|
||||
})) as ChatBotRecord[]
|
||||
|
||||
const content = msg.message.content as string
|
||||
const splitedContent = (content && content.split(' ')) || []
|
||||
for (let i = 0; i < bots.length; i++) {
|
||||
const bot = bots[i]
|
||||
|
||||
|
|
@ -565,15 +589,11 @@ async function interceptTribeMsgForHiddenCmds(
|
|||
bot.botPrefix === splitedContent[0] &&
|
||||
bot.hiddenCommands &&
|
||||
JSON.parse(bot.hiddenCommands).includes(splitedContent[1])
|
||||
const isPersonal = bot.botPrefix === ML_PREFIX
|
||||
if (isHidden || isPersonal) {
|
||||
await models.Message.update(
|
||||
{
|
||||
onlyOwner: true,
|
||||
},
|
||||
{ where: { uuid: msg.message.uuid, tenant } }
|
||||
)
|
||||
|
||||
const isDefaultHide =
|
||||
bot.botPrefix === splitedContent[0] &&
|
||||
hideAllCommandsBot.includes(bot.botPrefix)
|
||||
if (isHidden || isDefaultHide) {
|
||||
await updateMessageToIsOnlyOwner(msg.message.uuid, tenant)
|
||||
return true
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -433,6 +433,7 @@ export interface TribeInterface {
|
|||
owner_route_hint: string
|
||||
pin: string
|
||||
profile_filters?: string
|
||||
second_brain_url?: string
|
||||
}
|
||||
|
||||
export async function declare({
|
||||
|
|
@ -457,6 +458,7 @@ export async function declare({
|
|||
owner_route_hint,
|
||||
pin,
|
||||
profile_filters,
|
||||
second_brain_url,
|
||||
}: TribeInterface): Promise<void> {
|
||||
try {
|
||||
let protocol = 'https'
|
||||
|
|
@ -484,6 +486,7 @@ export async function declare({
|
|||
owner_route_hint: owner_route_hint || '',
|
||||
pin: pin || '',
|
||||
profile_filters,
|
||||
second_brain_url,
|
||||
}),
|
||||
headers: { 'Content-Type': 'application/json' },
|
||||
})
|
||||
|
|
@ -519,6 +522,7 @@ export async function edit({
|
|||
owner_pubkey,
|
||||
pin,
|
||||
profile_filters,
|
||||
second_brain_url,
|
||||
}: TribeInterface): Promise<void> {
|
||||
try {
|
||||
const token = await genSignedTimestamp(owner_pubkey)
|
||||
|
|
@ -546,6 +550,7 @@ export async function edit({
|
|||
owner_route_hint: owner_route_hint || '',
|
||||
pin: pin || '',
|
||||
profile_filters,
|
||||
second_brain_url: second_brain_url || '',
|
||||
}),
|
||||
headers: { 'Content-Type': 'application/json' },
|
||||
})
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue