mirror of
https://github.com/matrix-construct/construct
synced 2024-05-19 19:33:45 +02:00
modules/client: Add stub for dehydrated device.
This commit is contained in:
parent
f5a0a2fe11
commit
5e32f88b0d
|
@ -123,6 +123,7 @@ ircd::m::module_names
|
|||
"client_devices",
|
||||
"client_delete_devices",
|
||||
"client_send_to_device",
|
||||
"client_dehydrated_device",
|
||||
"client_keys_changes",
|
||||
"client_keys_upload",
|
||||
"client_keys_claim",
|
||||
|
|
|
@ -284,6 +284,7 @@ client_client_delete_devices_la_SOURCES = client/delete_devices.cc
|
|||
client_client_notifications_la_SOURCES = client/notifications.cc
|
||||
client_client_register_email_la_SOURCES = client/register_email.cc
|
||||
client_client_create_group_la_SOURCES = client/create_group.cc
|
||||
client_client_dehydrated_device_la_SOURCES = client/dehydrated_device.cc
|
||||
|
||||
client_module_LTLIBRARIES = \
|
||||
client/client_versions.la \
|
||||
|
@ -311,6 +312,7 @@ client_module_LTLIBRARIES = \
|
|||
client/client_notifications.la \
|
||||
client/client_register_email.la \
|
||||
client/client_create_group.la \
|
||||
client/client_dehydrated_device.la \
|
||||
###
|
||||
|
||||
#
|
||||
|
|
68
modules/client/dehydrated_device.cc
Normal file
68
modules/client/dehydrated_device.cc
Normal file
|
@ -0,0 +1,68 @@
|
|||
// 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
|
||||
{
|
||||
static resource::response get__dehydrated_device(client &, const m::resource::request &);
|
||||
extern resource::method dehydrated_device_get;
|
||||
|
||||
extern resource dehydrated_device_resource;
|
||||
}
|
||||
|
||||
ircd::mapi::header
|
||||
IRCD_MODULE
|
||||
{
|
||||
"Client :Dehydrated Device"
|
||||
};
|
||||
|
||||
decltype(ircd::m::dehydrated_device_resource)
|
||||
ircd::m::dehydrated_device_resource
|
||||
{
|
||||
"/_matrix/client/unstable/org.matrix.msc2697.v2/dehydrated_device",
|
||||
{
|
||||
"msc2697.v2 :Dehydrated Device"
|
||||
}
|
||||
};
|
||||
|
||||
decltype(ircd::m::dehydrated_device_get)
|
||||
ircd::m::dehydrated_device_get
|
||||
{
|
||||
dehydrated_device_resource, "GET", get__dehydrated_device,
|
||||
{
|
||||
dehydrated_device_get.REQUIRES_AUTH
|
||||
}
|
||||
};
|
||||
|
||||
ircd::m::resource::response
|
||||
ircd::m::get__dehydrated_device(client &client,
|
||||
const resource::request &request)
|
||||
{
|
||||
const auto device_id
|
||||
{
|
||||
user::tokens::device(request.access_token)
|
||||
};
|
||||
|
||||
const auto algorithm
|
||||
{
|
||||
"m.dehydration.v1.olm"
|
||||
};
|
||||
|
||||
return resource::response
|
||||
{
|
||||
client, json::members
|
||||
{
|
||||
{ "device_id", device_id },
|
||||
{ "device_data",
|
||||
{
|
||||
{ "algorithm", algorithm },
|
||||
}}
|
||||
}
|
||||
};
|
||||
}
|
Loading…
Reference in a new issue