0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2024-06-26 13:58:18 +02:00

ircd::json: Perform unquote() in json::string ctor as described...

This commit is contained in:
Jason Volk 2018-06-12 00:45:18 -07:00
parent f5b73ce0c4
commit 0d688b386b
3 changed files with 7 additions and 3 deletions

View file

@ -86,7 +86,11 @@ namespace ircd
struct ircd::json::string struct ircd::json::string
:string_view :string_view
{ {
using string_view::string_view; string(const string_view &s)
:string_view{unquote(s)}
{}
string() = default;
}; };
template<size_t SIZE> template<size_t SIZE>

View file

@ -165,7 +165,7 @@ try
m::event receipt; m::event receipt;
json::get<"depth"_>(receipt) = json::undefined_number; json::get<"depth"_>(receipt) = json::undefined_number;
json::get<"type"_>(receipt) = "m.receipt"; json::get<"type"_>(receipt) = "m.receipt"_sv;
json::get<"room_id"_>(receipt) = room_id; json::get<"room_id"_>(receipt) = room_id;
json::get<"sender"_>(receipt) = user_id; json::get<"sender"_>(receipt) = user_id;
json::get<"origin"_>(receipt) = user_id.host(); json::get<"origin"_>(receipt) = user_id.host();

View file

@ -81,7 +81,7 @@ _handle_edu_m_typing(const m::event &event,
m::event typing{event}; m::event typing{event};
json::get<"room_id"_>(typing) = room_id; json::get<"room_id"_>(typing) = room_id;
json::get<"type"_>(typing) = "m.typing"; json::get<"type"_>(typing) = "m.typing"_sv;
char buf[512]; char buf[512];
const json::value user_ids[] const json::value user_ids[]