Skip to content

Commit c146cfb

Browse files
committed
fix: changes needed for convo volatile wrapping
1 parent 63035a1 commit c146cfb

File tree

3 files changed

+11
-3
lines changed

3 files changed

+11
-3
lines changed

include/session/config/community.hpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,8 @@ struct community {
3535
// Same as above, but takes pubkey as an encoded (hex or base32z or base64) string.
3636
community(std::string_view base_url, std::string_view room, std::string_view pubkey_encoded);
3737

38+
community(std::string full_url);
39+
3840
// Takes a combined room URL (e.g. https://whatever.com/r/Room?public_key=01234....), either
3941
// new style (with /r/) or old style (without /r/). Note that the URL gets canonicalized so
4042
// the resulting `base_url()` and `room()` values may not be exactly equal to what is given.

src/config/community.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,10 @@ community::community(
3535
set_pubkey(pubkey_encoded);
3636
}
3737

38+
community::community(std::string full_url) {
39+
set_full_url(full_url);
40+
}
41+
3842
void community::set_full_url(std::string_view full_url) {
3943
auto [b_url, r_token, s_pubkey] = parse_full_url(full_url);
4044
base_url_ = std::move(b_url);

src/config/groups/keys.cpp

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -657,7 +657,7 @@ Keys::swarm_auth Keys::swarm_subaccount_sign_as_user(
657657
std::span<const unsigned char> user_ed25519_sk,
658658
std::span<const unsigned char> msg,
659659
std::span<const unsigned char> sign_val,
660-
bool binary) const {
660+
bool binary) {
661661

662662
if (sign_val.size() != 100)
663663
throw std::logic_error{"Invalid signing value: size is wrong"};
@@ -778,9 +778,11 @@ Keys::swarm_auth Keys::swarm_subaccount_sign(
778778
std::span<const unsigned char> msg,
779779
std::span<const unsigned char> sign_val,
780780
bool binary) const {
781-
auto user_ed25519_sk_buf = this->user_ed25519_sk.data();
781+
const unsigned char* user_ed25519_sk_buf = this->user_ed25519_sk.data();
782+
std::span<const unsigned char> user_ed25519_sk(
783+
user_ed25519_sk_buf, this->user_ed25519_sk.size());
782784

783-
return Keys::swarm_subaccount_sign_as_user(to_span(user_ed25519_sk_buf), msg, sign_val, binary);
785+
return Keys::swarm_subaccount_sign_as_user(user_ed25519_sk, msg, sign_val, binary);
784786
}
785787

786788
bool Keys::swarm_verify_subaccount(

0 commit comments

Comments
 (0)