File tree Expand file tree Collapse file tree 3 files changed +11
-3
lines changed Expand file tree Collapse file tree 3 files changed +11
-3
lines changed Original file line number Diff line number Diff 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.
Original file line number Diff line number Diff 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+
3842void 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);
Original file line number Diff line number Diff 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
786788bool Keys::swarm_verify_subaccount (
You can’t perform that action at this time.
0 commit comments