0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2024-12-26 15:33:54 +01:00

modules/m_typing: Move m.typing committer into client/rooms/typing.

This commit is contained in:
Jason Volk 2018-03-28 19:48:36 -07:00
parent cbc4852e16
commit d48f46a0ac
3 changed files with 27 additions and 27 deletions

View file

@ -717,7 +717,7 @@ ircd::m::typing::set(const m::typing &object)
static import<prototype> function
{
"m_typing", "typing_set"
"client_rooms", "commit__m_typing"
};
return function(object);

View file

@ -57,6 +57,7 @@ timeout_default
};
static ircd::steady_point calc_timesout(const resource::request &request);
extern "C" m::event::id::buf commit__m_typing(const m::typing &);
resource::response
put__typing(client &client,
@ -137,7 +138,7 @@ put__typing(client &client,
};
if(transmit)
m::typing::set(event);
commit__m_typing(event);
return resource::response
{
@ -145,6 +146,30 @@ put__typing(client &client,
};
}
m::event::id::buf
commit__m_typing(const m::typing &edu)
{
json::iov event, content;
const json::iov::push push[]
{
{ event, { "type", "m.typing" } },
{ event, { "room_id", at<"room_id"_>(edu) } },
{ content, { "user_id", at<"user_id"_>(edu) } },
{ content, { "room_id", at<"room_id"_>(edu) } },
{ content, { "typing", json::get<"typing"_>(edu) } },
};
m::vm::opts opts;
opts.hash = false;
opts.sign = false;
opts.event_id = false;
opts.origin = true;
opts.origin_server_ts = false;
opts.conforming = false;
return m::vm::commit(event, content, opts);
}
ircd::steady_point
calc_timesout(const resource::request &request)
{

View file

@ -18,31 +18,6 @@ IRCD_MODULE
static void _handle_edu_m_typing(const m::event &, const m::edu::m_typing &edu);
static void handle_edu_m_typing(const m::event &);
extern "C" m::event::id::buf typing_set(const m::typing &);
m::event::id::buf
typing_set(const m::typing &edu)
{
json::iov event, content;
const json::iov::push push[]
{
{ event, { "type", "m.typing" } },
{ event, { "room_id", at<"room_id"_>(edu) } },
{ content, { "user_id", at<"user_id"_>(edu) } },
{ content, { "room_id", at<"room_id"_>(edu) } },
{ content, { "typing", json::get<"typing"_>(edu) } },
};
m::vm::opts opts;
opts.hash = false;
opts.sign = false;
opts.event_id = false;
opts.origin = true;
opts.origin_server_ts = false;
opts.conforming = false;
return m::vm::commit(event, content, opts);
}
const m::hook
_m_typing_eval