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 {
35
35
// Same as above, but takes pubkey as an encoded (hex or base32z or base64) string.
36
36
community (std::string_view base_url, std::string_view room, std::string_view pubkey_encoded);
37
37
38
+ community (std::string full_url);
39
+
38
40
// Takes a combined room URL (e.g. https://whatever.com/r/Room?public_key=01234....), either
39
41
// new style (with /r/) or old style (without /r/). Note that the URL gets canonicalized so
40
42
// 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(
35
35
set_pubkey (pubkey_encoded);
36
36
}
37
37
38
+ community::community (std::string full_url) {
39
+ set_full_url (full_url);
40
+ }
41
+
38
42
void community::set_full_url (std::string_view full_url) {
39
43
auto [b_url, r_token, s_pubkey] = parse_full_url (full_url);
40
44
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(
657
657
std::span<const unsigned char > user_ed25519_sk,
658
658
std::span<const unsigned char > msg,
659
659
std::span<const unsigned char > sign_val,
660
- bool binary) const {
660
+ bool binary) {
661
661
662
662
if (sign_val.size () != 100 )
663
663
throw std::logic_error{" Invalid signing value: size is wrong" };
@@ -778,9 +778,11 @@ Keys::swarm_auth Keys::swarm_subaccount_sign(
778
778
std::span<const unsigned char > msg,
779
779
std::span<const unsigned char > sign_val,
780
780
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 ());
782
784
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);
784
786
}
785
787
786
788
bool Keys::swarm_verify_subaccount (
You can’t perform that action at this time.
0 commit comments