Skip to content

Commit 15151d7

Browse files
committed
chore: address PR reviews
1 parent d6c00f9 commit 15151d7

File tree

14 files changed

+51
-46
lines changed

14 files changed

+51
-46
lines changed

.github/workflows/test.yml

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,6 @@ jobs:
1717

1818
strategy:
1919
fail-fast: false
20-
21-
2220
matrix:
2321
os: [windows-2022, macos-12, ubuntu-20.04]
2422
env:
@@ -68,7 +66,6 @@ jobs:
6866
sed -i "s/target_compile_options(oxen-logging-warnings INTERFACE/#target_compile_options(oxen-logging-warnings INTERFACE/" libsession-util/external/oxen-libquic/external/oxen-logging/CMakeLists.txt
6967
cat libsession-util/external/oxen-libquic/external/oxen-logging/CMakeLists.txt
7068
71-
7269
- name: build libsession-util-nodejs
7370
shell: bash
74-
run: yarn install --frozen-lockfile
71+
run: yarn install --frozen-lockfile

src/base_config.hpp

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -106,19 +106,6 @@ class ConfigBaseImpl {
106106

107107
Napi::Env env = info.Env();
108108

109-
// config->logger = [env, class_name](session::config::LogLevel, std::string_view x) {
110-
// std::string toLog =
111-
// "libsession-util:" + std::string(class_name) + ": " + std::string(x) +
112-
// "\n";
113-
114-
// Napi::Function consoleLog = env.Global()
115-
// .Get("console")
116-
// .As<Napi::Object>()
117-
// .Get("log")
118-
// .As<Napi::Function>();
119-
// consoleLog.Call({Napi::String::New(env, toLog)});
120-
// };
121-
122109
return config;
123110
});
124111
}

src/blinding/blinding.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ class BlindingWrapper : public Napi::ObjectWrap<BlindingWrapper> {
1919
public:
2020
BlindingWrapper(const Napi::CallbackInfo& info) : Napi::ObjectWrap<BlindingWrapper>{info} {
2121
throw std::invalid_argument(
22-
"BlindingWrapper is all static and don't need to be constructed");
22+
"BlindingWrapper is static and doesn't need to be constructed");
2323
}
2424

2525
static void Init(Napi::Env env, Napi::Object exports) {

src/groups/meta_group_wrapper.cpp

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ void MetaGroupWrapper::Init(Napi::Env env, Napi::Object exports) {
2020
"MetaGroupWrapperNode",
2121
{
2222
// shared exposed functions
23-
2423
InstanceMethod("needsPush", &MetaGroupWrapper::needsPush),
2524
InstanceMethod("push", &MetaGroupWrapper::push),
2625
InstanceMethod("needsDump", &MetaGroupWrapper::needsDump),
@@ -39,7 +38,6 @@ void MetaGroupWrapper::Init(Napi::Env env, Napi::Object exports) {
3938
InstanceMethod("memberGetOrConstruct", &MetaGroupWrapper::memberGetOrConstruct),
4039
InstanceMethod(
4140
"memberConstructAndSet", &MetaGroupWrapper::memberConstructAndSet),
42-
4341
InstanceMethod("memberGetAll", &MetaGroupWrapper::memberGetAll),
4442
InstanceMethod(
4543
"memberGetAllPendingRemovals",
@@ -65,15 +63,12 @@ void MetaGroupWrapper::Init(Napi::Env env, Napi::Object exports) {
6563
InstanceMethod("memberEraseAndRekey", &MetaGroupWrapper::memberEraseAndRekey),
6664

6765
// keys exposed functions
68-
6966
InstanceMethod("keysNeedsRekey", &MetaGroupWrapper::keysNeedsRekey),
7067
InstanceMethod("keyRekey", &MetaGroupWrapper::keyRekey),
7168
InstanceMethod("keyGetAll", &MetaGroupWrapper::keyGetAll),
72-
7369
InstanceMethod("currentHashes", &MetaGroupWrapper::currentHashes),
7470
InstanceMethod("loadKeyMessage", &MetaGroupWrapper::loadKeyMessage),
7571
InstanceMethod("keyGetCurrentGen", &MetaGroupWrapper::keyGetCurrentGen),
76-
7772
InstanceMethod("encryptMessages", &MetaGroupWrapper::encryptMessages),
7873
InstanceMethod("decryptMessage", &MetaGroupWrapper::decryptMessage),
7974
InstanceMethod("makeSwarmSubAccount", &MetaGroupWrapper::makeSwarmSubAccount),
@@ -82,7 +77,6 @@ void MetaGroupWrapper::Init(Napi::Env env, Napi::Object exports) {
8277
"swarmVerifySubAccount", &MetaGroupWrapper::swarmVerifySubAccount),
8378
InstanceMethod("loadAdminKeys", &MetaGroupWrapper::loadAdminKeys),
8479
InstanceMethod("keysAdmin", &MetaGroupWrapper::keysAdmin),
85-
8680
InstanceMethod("swarmSubaccountSign", &MetaGroupWrapper::swarmSubaccountSign),
8781
InstanceMethod(
8882
"generateSupplementKeys", &MetaGroupWrapper::generateSupplementKeys),
@@ -538,7 +532,6 @@ void MetaGroupWrapper::memberSetPromotionAccepted(const Napi::CallbackInfo& info
538532
}
539533

540534
void MetaGroupWrapper::memberSetProfilePicture(const Napi::CallbackInfo& info) {
541-
542535
wrapExceptions(info, [&] {
543536
assertInfoLength(info, 2);
544537
assertIsString(info[0]);

src/groups/meta_group_wrapper.hpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,6 @@ class MetaGroupWrapper : public Napi::ObjectWrap<MetaGroupWrapper> {
120120
void membersMarkPendingRemoval(const Napi::CallbackInfo& info);
121121

122122
/** Keys Actions */
123-
124123
Napi::Value keysNeedsRekey(const Napi::CallbackInfo& info);
125124
Napi::Value keyRekey(const Napi::CallbackInfo& info);
126125
Napi::Value keyGetAll(const Napi::CallbackInfo& info);

src/meta/meta_base_wrapper.hpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,6 @@ class MetaBaseWrapper {
6868
std::optional<ustring_view> dumped_keys;
6969

7070
if (dumped_meta) {
71-
7271
auto dumped_meta_str = from_unsigned_sv(*dumped_meta);
7372

7473
oxenc::bt_dict_consumer combined{dumped_meta_str};

src/multi_encrypt/multi_encrypt.hpp

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,20 +4,19 @@
44

55
#include <algorithm>
66

7+
#include "../utilities.hpp"
78
#include "session/config/user_profile.hpp"
89
#include "session/multi_encrypt.hpp"
910
#include "session/random.hpp"
10-
#include "../utilities.hpp"
1111

1212
namespace session::nodeapi {
1313

1414
class MultiEncryptWrapper : public Napi::ObjectWrap<MultiEncryptWrapper> {
15-
1615
public:
1716
MultiEncryptWrapper(const Napi::CallbackInfo& info) :
1817
Napi::ObjectWrap<MultiEncryptWrapper>{info} {
1918
throw std::invalid_argument(
20-
"MultiEncryptWrapper is all static and don't need to be constructed");
19+
"MultiEncryptWrapper is static and doesn't need to be constructed");
2120
}
2221

2322
static void Init(Napi::Env env, Napi::Object exports) {
@@ -85,7 +84,7 @@ class MultiEncryptWrapper : public Napi::ObjectWrap<MultiEncryptWrapper> {
8584
std::vector<ustring_view> messages_sv(messages.begin(), messages.end());
8685
std::vector<ustring_view> recipients_sv(recipients.begin(), recipients.end());
8786

88-
// Note: this function needs the first 2 args to be vector of sv explicitely
87+
// Note: this function needs the first 2 args to be vector of sv explicitly
8988
return session::encrypt_for_multiple_simple(
9089
messages_sv, recipients_sv, ed25519SecretKey, domain, random_nonce);
9190
});

src/user_config.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99

1010
namespace session::nodeapi {
1111

12-
// using config::LogLevel;
1312
using config::UserProfile;
1413

1514
void UserConfigWrapper::Init(Napi::Env env, Napi::Object exports) {

src/utilities.hpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,6 @@ struct toJs_impl<std::unordered_set<T>> {
149149
auto arr = Napi::Array::New(env, as_array.size());
150150
for (size_t i = 0; i < as_array.size(); i++)
151151
arr[i] = toJs(env, as_array[i]);
152-
153152
return arr;
154153
}
155154
};

types/groups/groupmembers.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ declare module 'libsession_util_nodejs' {
5555
// setters
5656
memberSetNameTruncated: (pubkeyHex: PubkeyType, newName: string) => void;
5757

58-
/** A member invite states defaults to invite-not-sent. Use this function to mark that you've sent one, or at least tried (failed: boolean)*/
58+
/** A member's invite state defaults to invite-not-sent. Use this function to mark that you've sent one, or at least tried (failed: boolean)*/
5959
memberSetInvited: (pubkeyHex: PubkeyType, failed: boolean) => void;
6060
/** User has accepted an invitation and is now a regular member of the group */
6161
memberSetAccepted: (pubkeyHex: PubkeyType) => void;

0 commit comments

Comments
 (0)