Skip to content

Commit 354f179

Browse files
committed
chore: remove getProfilePicWithKeyHex
1 parent c4bc1f7 commit 354f179

File tree

4 files changed

+5
-27
lines changed

4 files changed

+5
-27
lines changed

include/user_config.hpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ class UserConfigWrapper : public ConfigBaseImpl, public Napi::ObjectWrap<UserCon
2020
Napi::Value getPriority(const Napi::CallbackInfo& info);
2121
Napi::Value getName(const Napi::CallbackInfo& info);
2222
Napi::Value getProfilePic(const Napi::CallbackInfo& info);
23-
Napi::Value getProfilePicWithKeyHex(const Napi::CallbackInfo& info);
2423

2524
void setPriority(const Napi::CallbackInfo& info);
2625
void setName(const Napi::CallbackInfo& info);

include/utilities.hpp

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -149,9 +149,11 @@ struct toJs_impl<std::vector<unsigned char>> {
149149
template <>
150150
struct toJs_impl<std::vector<std::byte>> {
151151
auto operator()(const Napi::Env& env, std::vector<std::byte> b) const {
152-
auto data = b.data();
153-
auto data_uchar = reinterpret_cast<const unsigned char*>(data, b.size());
154-
return Napi::Buffer<uint8_t>::Copy(env, data_uchar, b.size());
152+
return Napi::Buffer<uint8_t>::Copy(
153+
env,
154+
reinterpret_cast<const unsigned char*>(b.data()),
155+
b.size()
156+
);
155157
}
156158
};
157159

src/user_config.cpp

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,6 @@ void UserConfigWrapper::Init(Napi::Env env, Napi::Object exports) {
2020
InstanceMethod("getPriority", &UserConfigWrapper::getPriority),
2121
InstanceMethod("getName", &UserConfigWrapper::getName),
2222
InstanceMethod("getProfilePic", &UserConfigWrapper::getProfilePic),
23-
InstanceMethod(
24-
"getProfilePicWithKeyHex", &UserConfigWrapper::getProfilePicWithKeyHex),
2523
InstanceMethod(
2624
"getProfileUpdatedSeconds",
2725
&UserConfigWrapper::getProfileUpdatedSeconds),
@@ -143,18 +141,6 @@ Napi::Value UserConfigWrapper::getProfileUpdatedSeconds(const Napi::CallbackInfo
143141
});
144142
}
145143

146-
Napi::Value UserConfigWrapper::getProfilePicWithKeyHex(const Napi::CallbackInfo& info) {
147-
return wrapResult(info, [&]() -> std::optional<std::string> {
148-
auto env = info.Env();
149-
auto pic = config.get_profile_pic();
150-
// if pic.key and url are set, return a combined string with both merged by a hash, and the
151-
// key in hex
152-
if (!pic.url.empty() && !pic.key.empty()) {
153-
return std::string(pic.url + "#" + to_hex(pic.key));
154-
}
155-
return std::nullopt;
156-
});
157-
}
158144

159145
Napi::Value UserConfigWrapper::getEnableBlindedMsgRequest(const Napi::CallbackInfo& info) {
160146
return wrapResult(info, [&] {

types/user/userconfig.d.ts

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -28,13 +28,6 @@ declare module 'libsession_util_nodejs' {
2828
setReuploadProfilePic: (pic: ProfilePicture) => void;
2929

3030
getProfileUpdatedSeconds: () => number;
31-
/**
32-
* Returns the profile picture url and key merged as a url fragment, or null if not set.
33-
* So this could return something like
34-
* `http://filev2.getsession.org/file/1234#ba7e23ef3d4dc54b706d79c149ec571a4d64043e13771236afc030f6c8118575`
35-
*
36-
*/
37-
getProfilePicWithKeyHex: () => string | undefined;
3831

3932
setEnableBlindedMsgRequest: (msgRequest: boolean) => void;
4033
getEnableBlindedMsgRequest: () => boolean | undefined;
@@ -61,7 +54,6 @@ declare module 'libsession_util_nodejs' {
6154
public setNewProfilePic: UserConfigWrapper['setNewProfilePic'];
6255
public setReuploadProfilePic: UserConfigWrapper['setReuploadProfilePic'];
6356
public getProfileUpdatedSeconds: UserConfigWrapper['getProfileUpdatedSeconds'];
64-
public getProfilePicWithKeyHex: UserConfigWrapper['getProfilePicWithKeyHex'];
6557
public getEnableBlindedMsgRequest: UserConfigWrapper['getEnableBlindedMsgRequest'];
6658
public setEnableBlindedMsgRequest: UserConfigWrapper['setEnableBlindedMsgRequest'];
6759
public getNoteToSelfExpiry: UserConfigWrapper['getNoteToSelfExpiry'];
@@ -85,7 +77,6 @@ declare module 'libsession_util_nodejs' {
8577
| MakeActionCall<UserConfigWrapper, 'setNewProfilePic'>
8678
| MakeActionCall<UserConfigWrapper, 'setReuploadProfilePic'>
8779
| MakeActionCall<UserConfigWrapper, 'getProfileUpdatedSeconds'>
88-
| MakeActionCall<UserConfigWrapper, 'getProfilePicWithKeyHex'>
8980
| MakeActionCall<UserConfigWrapper, 'getEnableBlindedMsgRequest'>
9081
| MakeActionCall<UserConfigWrapper, 'setEnableBlindedMsgRequest'>
9182
| MakeActionCall<UserConfigWrapper, 'getNoteToSelfExpiry'>

0 commit comments

Comments
 (0)