chat: remove join_password check from per-channel JOIN_INFO_REQ (server-link only)
This commit is contained in:
1 parent
39a1da4c28
commit
de850db548
1 file changed
+1
-22
+1
-22
@@ -1009,28 +1009,7 @@ static void cs_handle_join_info_req(struct chat_sync* cs, uint64_t peer,
|
||||
return;
|
||||
}
|
||||
|
||||
/* 2. пароль (если настроен на сервере) */
|
||||
char req_password[128] = "";
|
||||
if (len >= 10) {
|
||||
uint8_t plen2 = pl[9];
|
||||
if (plen2 > 0 && plen2 <= len - 10) {
|
||||
if (plen2 > 127) plen2 = 127;
|
||||
memcpy(req_password, pl + 10, plen2); req_password[plen2] = '\0';
|
||||
}
|
||||
}
|
||||
{
|
||||
struct global_config *gcfg = &cs->inst->config->global;
|
||||
if (gcfg->chatserver_enabled && gcfg->chatserver_join_password[0]) {
|
||||
if (strcmp(req_password, gcfg->chatserver_join_password) != 0) {
|
||||
DEBUG_WARN(DEBUG_CATEGORY_MEMBER_SYNC, "%s: JOIN_INFO_REQ wrong password ch=%s from=%016llx", CS_ID, ch_id, (unsigned long long)peer);
|
||||
uint8_t err[2] = { CS_MSG_ERROR, 0x01 };
|
||||
cs_send(cs, ch_id, peer, err, 2);
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* 3. инфо канала */
|
||||
/* 2. инфо канала */
|
||||
char name[128]; uint64_t owner; uint8_t ch_x25519[32], ch_ed[32], ch_sig[64];
|
||||
if (topo_node_sqlite_channel_get(cs->inst->topo_sqlite_db,
|
||||
ch_id, name, (int)sizeof(name), &owner, ch_x25519, ch_ed, ch_sig) != 0) {
|
||||
|
||||
Reference in new issue
Block a user