0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2024-12-26 07:23:53 +01:00

modules/client/sync/rooms/ephemeral: Add m.typing sync handler.

This commit is contained in:
Jason Volk 2019-02-27 18:18:17 -08:00
parent b9cf3e6c18
commit 4724110736
2 changed files with 54 additions and 0 deletions

View file

@ -332,9 +332,11 @@ client_module_LTLIBRARIES += \
# client/sync/rooms/ephemeral/
client_client_sync_rooms_ephemeral_receipt_la_SOURCES = client/sync/rooms/ephemeral/receipt.cc
client_client_sync_rooms_ephemeral_typing_la_SOURCES = client/sync/rooms/ephemeral/typing.cc
client_module_LTLIBRARIES += \
client/client_sync_rooms_ephemeral_receipt.la \
client/client_sync_rooms_ephemeral_typing.la \
###
#

View file

@ -0,0 +1,52 @@
// Matrix Construct
//
// Copyright (C) Matrix Construct Developers, Authors & Contributors
// Copyright (C) 2016-2019 Jason Volk <jason@zemos.net>
//
// Permission to use, copy, modify, and/or distribute this software for any
// purpose with or without fee is hereby granted, provided that the above
// copyright notice and this permission notice is present in all copies. The
// full license for this software is available in the LICENSE file.
ircd::mapi::header
IRCD_MODULE
{
"Client Sync :Room Ephemeral :Typing"
};
namespace ircd::m::sync
{
static bool room_ephemeral_m_typing_polylog(data &);
static bool room_ephemeral_m_typing_linear(data &);
extern item room_ephemeral_m_typing;
}
decltype(ircd::m::sync::room_ephemeral_m_typing)
ircd::m::sync::room_ephemeral_m_typing
{
"rooms.ephemeral.m_typing",
room_ephemeral_m_typing_polylog,
room_ephemeral_m_typing_linear
};
bool
ircd::m::sync::room_ephemeral_m_typing_linear(data &data)
{
assert(data.event);
if(json::get<"type"_>(*data.event) != "m.typing")
return false;
json::stack::object object
{
*data.out
};
object.append(*data.event);
return true;
}
bool
ircd::m::sync::room_ephemeral_m_typing_polylog(data &data)
{
return false;
}