Skip to content

Commit 1709462

Browse files
committed
feat: moved community url max length to cpp in libsession_util
1 parent 4f5c52b commit 1709462

File tree

3 files changed

+5
-7
lines changed

3 files changed

+5
-7
lines changed

shared.d.ts

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -73,10 +73,9 @@ declare module 'libsession_util_nodejs' {
7373
/** 100 bytes */
7474
GROUP_INFO_MAX_NAME_LENGTH: number;
7575
/** 411 bytes
76-
*
77-
* COMMUNITY_BASE_URL_MAX_LENGTH + '/r/' + COMMUNITY_ROOM_MAX_LENGTH
78-
qs_pubkey.size() + hex pubkey + null terminator
79-
*/
76+
*
77+
* BASE_URL_MAX_LENGTH + '/r/' + ROOM_MAX_LENGTH + qs_pubkey.size() + hex pubkey + null terminator
78+
*/
8079
COMMUNITY_FULL_URL_MAX_LENGTH: number;
8180
};
8281

src/constants.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
#include "constants.hpp"
22

3-
#include "session/config/community.h"
43
#include "session/config/contacts.hpp"
54
#include "session/config/groups/info.hpp"
65
#include "session/config/user_groups.hpp"
@@ -30,7 +29,7 @@ Napi::Object ConstantsWrapper::Init(Napi::Env env, Napi::Object exports) {
3029
napi_enumerable),
3130
ObjectWrap::StaticValue(
3231
"COMMUNITY_FULL_URL_MAX_LENGTH",
33-
Napi::Number::New(env, COMMUNITY_FULL_URL_MAX_LENGTH),
32+
Napi::Number::New(env, session::config::community::FULL_URL_MAX_LENGTH),
3433
napi_enumerable)});
3534

3635
// export object as javascript module

0 commit comments

Comments
 (0)