diff --git a/modules/Makefile.am b/modules/Makefile.am index f2e35362d..78d6b0224 100644 --- a/modules/Makefile.am +++ b/modules/Makefile.am @@ -289,11 +289,17 @@ client_module_LTLIBRARIES += \ client_client_sync_account_data_la_SOURCES = client/sync/account_data.cc client_client_sync_presence_la_SOURCES = client/sync/presence.cc client_client_sync_rooms_la_SOURCES = client/sync/rooms.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_module_LTLIBRARIES += \ client/client_sync_account_data.la \ client/client_sync_presence.la \ client/client_sync_rooms.la \ + client/client_sync_to_device.la \ + client/client_sync_device_lists.la \ + client/client_sync_device_one_time_keys_count.la \ ### # client/sync/rooms/ diff --git a/modules/client/sync/device_lists.cc b/modules/client/sync/device_lists.cc new file mode 100644 index 000000000..1bd344e9b --- /dev/null +++ b/modules/client/sync/device_lists.cc @@ -0,0 +1,56 @@ +// Matrix Construct +// +// Copyright (C) Matrix Construct Developers, Authors & Contributors +// Copyright (C) 2016-2018 Jason Volk +// +// 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 :Device Lists" +}; + +namespace ircd::m::sync +{ + static void device_lists_polylog(data &); + static void device_lists_linear(data &); + + extern item device_lists; +} + +decltype(ircd::m::sync::device_lists) +ircd::m::sync::device_lists +{ + "device_lists", + device_lists_polylog, + device_lists_linear +}; + +void +ircd::m::sync::device_lists_linear(data &data) +{ + +} + +void +ircd::m::sync::device_lists_polylog(data &data) +{ + json::stack::object object + { + data.out + }; + + json::stack::array + { + data.out, "changed" + }; + + json::stack::array + { + data.out, "left" + }; +} diff --git a/modules/client/sync/device_one_time_keys_count.cc b/modules/client/sync/device_one_time_keys_count.cc new file mode 100644 index 000000000..f492bfea3 --- /dev/null +++ b/modules/client/sync/device_one_time_keys_count.cc @@ -0,0 +1,47 @@ +// Matrix Construct +// +// Copyright (C) Matrix Construct Developers, Authors & Contributors +// Copyright (C) 2016-2018 Jason Volk +// +// 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 :Device One Time Keys Count" +}; + +namespace ircd::m::sync +{ + static void device_one_time_keys_count_polylog(data &); + static void device_one_time_keys_count_linear(data &); + + extern item device_one_time_keys_count; +} + +decltype(ircd::m::sync::device_one_time_keys_count) +ircd::m::sync::device_one_time_keys_count +{ + "device_one_time_keys_count", + device_one_time_keys_count_polylog, + device_one_time_keys_count_linear +}; + +void +ircd::m::sync::device_one_time_keys_count_linear(data &data) +{ + +} + +void +ircd::m::sync::device_one_time_keys_count_polylog(data &data) +{ + json::stack::object object + { + data.out + }; + +} diff --git a/modules/client/sync/to_device.cc b/modules/client/sync/to_device.cc new file mode 100644 index 000000000..f175a6fb3 --- /dev/null +++ b/modules/client/sync/to_device.cc @@ -0,0 +1,56 @@ +// Matrix Construct +// +// Copyright (C) Matrix Construct Developers, Authors & Contributors +// Copyright (C) 2016-2018 Jason Volk +// +// 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 :To Device" +}; + +namespace ircd::m::sync +{ + static void to_device_polylog(data &); + static void to_device_linear(data &); + + extern item to_device; +} + +decltype(ircd::m::sync::to_device) +ircd::m::sync::to_device +{ + "to_device", + to_device_polylog, + to_device_linear +}; + +void +ircd::m::sync::to_device_linear(data &data) +{ + +} + +void +ircd::m::sync::to_device_polylog(data &data) +{ + json::stack::object object + { + data.out + }; + + json::stack::array array + { + data.out, "events" + }; + + const m::room::state &state + { + data.user_state + }; +}