modules/client/sync: Stub device_unused_fallback_key_types.

This commit is contained in:
Jason Volk 2023-04-21 22:54:36 -07:00
parent 956aa7682f
commit 6072229dcc
3 changed files with 67 additions and 0 deletions

View File

@ -157,6 +157,7 @@ ircd::m::module_names
"client_sync_account_data",
"client_sync_device_lists",
"client_sync_device_one_time_keys_count",
"client_sync_device_unused_fallback_key_types",
"client_sync_groups",
"client_sync_presence",
"client_sync_to_device",

View File

@ -443,6 +443,7 @@ client_client_sync_groups_la_SOURCES = client/sync/groups.cc
client_client_sync_to_device_la_SOURCES = client/sync/to_device.cc
client_client_sync_device_lists_la_SOURCES = client/sync/device_lists.cc
client_client_sync_device_one_time_keys_count_la_SOURCES = client/sync/device_one_time_keys_count.cc
client_client_sync_device_unused_fallback_key_types_la_SOURCES = client/sync/device_unused_fallback_key_types.cc
client_module_LTLIBRARIES += \
client/client_sync_account_data.la \
@ -452,6 +453,7 @@ client_module_LTLIBRARIES += \
client/client_sync_to_device.la \
client/client_sync_device_lists.la \
client/client_sync_device_one_time_keys_count.la \
client/client_sync_device_unused_fallback_key_types.la \
###
# client/sync/rooms/

View File

@ -0,0 +1,64 @@
// Matrix Construct
//
// Copyright (C) Matrix Construct Developers, Authors & Contributors
// Copyright (C) 2016-2023 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.
namespace ircd::m::sync
{
static bool device_unused_fallback_key_types_polylog(data &);
static bool device_unused_fallback_key_types_linear(data &);
extern item device_unused_fallback_key_types;
}
ircd::mapi::header
IRCD_MODULE
{
"Client Sync :Device Unused Fallback Key Types"
};
decltype(ircd::m::sync::device_unused_fallback_key_types)
ircd::m::sync::device_unused_fallback_key_types
{
"device_unused_fallback_key_types",
device_unused_fallback_key_types_polylog,
device_unused_fallback_key_types_linear
};
bool
ircd::m::sync::device_unused_fallback_key_types_linear(data &data)
{
if(!data.device_id)
return false;
if(!data.event || !data.event->event_id)
return false;
if(!startswith(json::get<"type"_>(*data.event), "ircd.device"))
return false;
if(json::get<"room_id"_>(*data.event) != data.user_room)
return false;
json::stack::array array
{
*data.out, "device_unused_fallback_key_types"
};
array.append("signed_curve25519");
return true;
}
bool
ircd::m::sync::device_unused_fallback_key_types_polylog(data &data)
{
if(!data.device_id)
return false;
return false;
}