@@ -119,8 +119,6 @@ struct contact_info {
119119};
120120
121121struct blinded_contact_info {
122- community comm;
123-
124122 const std::string session_id () const ; // in hex
125123 std::string name;
126124 profile_pic profile_picture;
@@ -153,17 +151,51 @@ struct blinded_contact_info {
153151 // / - `name` -- Name to assign to the contact
154152 void set_name (std::string name);
155153
154+ // / API: contacts/blinded_contact_info::community_base_url
155+ // /
156+ // / Accesses the base url for the community (i.e. not including room or pubkey). Always
157+ // / lower-case/normalized.
158+ // /
159+ // / Inputs: None
160+ // /
161+ // / Outputs:
162+ // / - `const std::string&` -- Returns the base url
163+ const std::string& community_base_url () const { return comm.base_url (); }
164+
165+ // / API: contacts/blinded_contact_info::community_pubkey
166+ // /
167+ // / Accesses the community server pubkey (32 bytes).
168+ // /
169+ // / Inputs: None
170+ // /
171+ // / Outputs:
172+ // / - `const std::vector<unsigned char>&` -- Returns the pubkey
173+ const std::vector<unsigned char >& community_pubkey () const { return comm.pubkey (); }
174+
175+ // / API: contacts/blinded_contact_info::community_pubkey_hex
176+ // /
177+ // / Accesses the community server pubkey as hex (64 hex digits).
178+ // /
179+ // / Inputs: None
180+ // /
181+ // / Outputs:
182+ // / - `std::string` -- Returns the pubkey
183+ std::string community_pubkey_hex () const { return comm.pubkey_hex (); }
184+
185+ private:
186+ friend class Contacts ;
187+ friend struct session ::config::comm_iterator_helper;
188+
189+ community comm;
190+
191+ void load (const dict& info_dict);
192+
156193 // / These functions are here so we can use the `comm_iterator_helper` for loading data
157194 // / into this struct
158195 void set_base_url (std::string_view base_url);
159196 void set_room (std::string_view room);
160197 void set_pubkey (std::span<const unsigned char > pubkey);
161198 void set_pubkey (std::string_view pubkey);
162-
163- private:
164- friend class Contacts ;
165- friend struct session ::config::comm_iterator_helper;
166- void load (const dict& info_dict);
167199};
168200
169201class Contacts : public ConfigBase {
0 commit comments