diff --git a/include/ircd/m/groups.h b/include/ircd/m/groups.h new file mode 100644 index 000000000..24715c3d9 --- /dev/null +++ b/include/ircd/m/groups.h @@ -0,0 +1,17 @@ +// The Construct +// +// Copyright (C) The Construct Developers, Authors & Contributors +// Copyright (C) 2016-2020 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. + +#pragma once +#define HAVE_IRCD_M_GROUPS_H + +namespace ircd::m::groups +{ + extern log::log log; +} diff --git a/include/ircd/m/m.h b/include/ircd/m/m.h index e30370f33..3beb83d13 100644 --- a/include/ircd/m/m.h +++ b/include/ircd/m/m.h @@ -71,6 +71,7 @@ namespace ircd #include "users.h" #include "rooms.h" #include "rooms_summary.h" +#include "groups.h" #include "membership.h" #include "filter.h" #include "events.h" diff --git a/matrix/Makefile.am b/matrix/Makefile.am index 65841e522..20ab89e0c 100644 --- a/matrix/Makefile.am +++ b/matrix/Makefile.am @@ -145,6 +145,7 @@ libircd_matrix_la_SOURCES += fed_well_known.cc libircd_matrix_la_SOURCES += feds.cc libircd_matrix_la_SOURCES += fetch.cc libircd_matrix_la_SOURCES += gossip.cc +libircd_matrix_la_SOURCES += groups.cc libircd_matrix_la_SOURCES += request.cc libircd_matrix_la_SOURCES += keys.cc libircd_matrix_la_SOURCES += node.cc diff --git a/matrix/groups.cc b/matrix/groups.cc new file mode 100644 index 000000000..d27aaba1f --- /dev/null +++ b/matrix/groups.cc @@ -0,0 +1,15 @@ +// The Construct +// +// Copyright (C) The Construct Developers, Authors & Contributors +// Copyright (C) 2016-2020 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. + +decltype(ircd::m::groups::log) +ircd::m::groups::log +{ + "m.groups" +}; diff --git a/matrix/matrix.cc b/matrix/matrix.cc index d83dd3c9f..6a18b370c 100644 --- a/matrix/matrix.cc +++ b/matrix/matrix.cc @@ -131,6 +131,7 @@ ircd::m::matrix::module_names "client_room_keys_version", "client_room_keys_keys", "client_presence", + "client_groups", "client_joined_groups", "client_publicised_groups", "client_create_group", diff --git a/modules/Makefile.am b/modules/Makefile.am index c4ce77a6a..6527d88f1 100644 --- a/modules/Makefile.am +++ b/modules/Makefile.am @@ -511,6 +511,27 @@ client_module_LTLIBRARIES += \ client/client_room_keys_keys.la \ ### +# +# client/groups +# + +client_client_groups_la_SOURCES = \ + client/groups/profile.cc \ + client/groups/summary.cc \ + client/groups/categories.cc \ + client/groups/roles.cc \ + client/groups/rooms.cc \ + client/groups/users.cc \ + client/groups/invited_users.cc \ + client/groups/settings.cc \ + client/groups/self.cc \ + client/groups/groups.cc \ + ### + +client_module_LTLIBRARIES += \ + client/client_groups.la \ + ### + ############################################################################### # # /_synapse/admin/ diff --git a/modules/client/groups/categories.cc b/modules/client/groups/categories.cc new file mode 100644 index 000000000..1bbf42ad7 --- /dev/null +++ b/modules/client/groups/categories.cc @@ -0,0 +1,11 @@ +// The Construct +// +// Copyright (C) The Construct Developers, Authors & Contributors +// Copyright (C) 2016-2020 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. + +#include "groups.h" diff --git a/modules/client/groups/groups.cc b/modules/client/groups/groups.cc new file mode 100644 index 000000000..dcc79f0a6 --- /dev/null +++ b/modules/client/groups/groups.cc @@ -0,0 +1,55 @@ +// The Construct +// +// Copyright (C) The Construct Developers, Authors & Contributors +// Copyright (C) 2016-2020 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. + +#include "groups.h" + +namespace ircd::m::groups +{ + static resource::response handle_get(client &, const resource::request &); + extern resource::method groups_get; + + extern resource groups_resource; +} + +ircd::mapi::header +IRCD_MODULE +{ + "Client (unspecified) :Groups", +}; + +decltype(ircd::m::groups::groups_resource) +ircd::m::groups::groups_resource +{ + "/_matrix/client/r0/groups", + { + "(undocumented/unspecified) Groups", + resource::DIRECTORY + } +}; + +decltype(ircd::m::groups::groups_get) +ircd::m::groups::groups_get +{ + groups_resource, "GET", handle_get, + { + groups_get.REQUIRES_AUTH + } +}; + +ircd::m::resource::response +ircd::m::groups::handle_get(client &client, + const resource::request &request) +{ + + return resource::response + { + client, http::NOT_FOUND + }; +} diff --git a/modules/client/groups/groups.h b/modules/client/groups/groups.h new file mode 100644 index 000000000..94b2dc9c7 --- /dev/null +++ b/modules/client/groups/groups.h @@ -0,0 +1,14 @@ +// The Construct +// +// Copyright (C) The Construct Developers, Authors & Contributors +// Copyright (C) 2016-2020 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. + +namespace ircd::m::groups +{ + +} diff --git a/modules/client/groups/invited_users.cc b/modules/client/groups/invited_users.cc new file mode 100644 index 000000000..1bbf42ad7 --- /dev/null +++ b/modules/client/groups/invited_users.cc @@ -0,0 +1,11 @@ +// The Construct +// +// Copyright (C) The Construct Developers, Authors & Contributors +// Copyright (C) 2016-2020 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. + +#include "groups.h" diff --git a/modules/client/groups/profile.cc b/modules/client/groups/profile.cc new file mode 100644 index 000000000..1bbf42ad7 --- /dev/null +++ b/modules/client/groups/profile.cc @@ -0,0 +1,11 @@ +// The Construct +// +// Copyright (C) The Construct Developers, Authors & Contributors +// Copyright (C) 2016-2020 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. + +#include "groups.h" diff --git a/modules/client/groups/roles.cc b/modules/client/groups/roles.cc new file mode 100644 index 000000000..1bbf42ad7 --- /dev/null +++ b/modules/client/groups/roles.cc @@ -0,0 +1,11 @@ +// The Construct +// +// Copyright (C) The Construct Developers, Authors & Contributors +// Copyright (C) 2016-2020 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. + +#include "groups.h" diff --git a/modules/client/groups/rooms.cc b/modules/client/groups/rooms.cc new file mode 100644 index 000000000..1bbf42ad7 --- /dev/null +++ b/modules/client/groups/rooms.cc @@ -0,0 +1,11 @@ +// The Construct +// +// Copyright (C) The Construct Developers, Authors & Contributors +// Copyright (C) 2016-2020 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. + +#include "groups.h" diff --git a/modules/client/groups/self.cc b/modules/client/groups/self.cc new file mode 100644 index 000000000..1bbf42ad7 --- /dev/null +++ b/modules/client/groups/self.cc @@ -0,0 +1,11 @@ +// The Construct +// +// Copyright (C) The Construct Developers, Authors & Contributors +// Copyright (C) 2016-2020 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. + +#include "groups.h" diff --git a/modules/client/groups/settings.cc b/modules/client/groups/settings.cc new file mode 100644 index 000000000..1bbf42ad7 --- /dev/null +++ b/modules/client/groups/settings.cc @@ -0,0 +1,11 @@ +// The Construct +// +// Copyright (C) The Construct Developers, Authors & Contributors +// Copyright (C) 2016-2020 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. + +#include "groups.h" diff --git a/modules/client/groups/summary.cc b/modules/client/groups/summary.cc new file mode 100644 index 000000000..1bbf42ad7 --- /dev/null +++ b/modules/client/groups/summary.cc @@ -0,0 +1,11 @@ +// The Construct +// +// Copyright (C) The Construct Developers, Authors & Contributors +// Copyright (C) 2016-2020 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. + +#include "groups.h" diff --git a/modules/client/groups/users.cc b/modules/client/groups/users.cc new file mode 100644 index 000000000..1bbf42ad7 --- /dev/null +++ b/modules/client/groups/users.cc @@ -0,0 +1,11 @@ +// The Construct +// +// Copyright (C) The Construct Developers, Authors & Contributors +// Copyright (C) 2016-2020 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. + +#include "groups.h"