diff --git a/modules/Makefile.am b/modules/Makefile.am index eb0419851..17a8c4074 100644 --- a/modules/Makefile.am +++ b/modules/Makefile.am @@ -468,12 +468,13 @@ media_module_LTLIBRARIES = \ app_moduledir = @moduledir@ -app_app_register_la_SOURCES = \ - app/register.cc \ +app_app_app_la_SOURCES = \ + app/app.cc \ + app/transactions.cc \ ### app_module_LTLIBRARIES = \ - app/app_register.la \ + app/app_app.la \ ### ############################################################################### diff --git a/modules/app/app.cc b/modules/app/app.cc new file mode 100644 index 000000000..f3268e89b --- /dev/null +++ b/modules/app/app.cc @@ -0,0 +1,41 @@ +// Matrix Construct +// +// Copyright (C) Matrix Construct Developers, Authors & Contributors +// Copyright (C) 2016-2019 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 "app.h" + +ircd::mapi::header +IRCD_MODULE +{ + "Application Services", + ircd::m::app::init, + ircd::m::app::fini +}; + +decltype(ircd::m::app::app_room_id) +ircd::m::app::app_room_id +{ + "app", my_host() +}; + +decltype(ircd::m::app::apps) +ircd::m::app::apps; + +void +ircd::m::app::init() +{ + if(!m::exists(app_room_id)) + m::create(app_room_id, m::me, "internal"); +} + +void +ircd::m::app::fini() +{ + +} diff --git a/modules/app/app.h b/modules/app/app.h new file mode 100644 index 000000000..423c1c9d2 --- /dev/null +++ b/modules/app/app.h @@ -0,0 +1,19 @@ +// Matrix Construct +// +// Copyright (C) Matrix Construct Developers, Authors & Contributors +// Copyright (C) 2016-2019 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. + +// app.cc +namespace ircd::m::app +{ + void init(); + void fini(); + + extern const m::room::id::buf app_room_id; + extern std::map apps; +} diff --git a/modules/app/register.cc b/modules/app/transactions.cc similarity index 71% rename from modules/app/register.cc rename to modules/app/transactions.cc index ab0ae7289..9204e9979 100644 --- a/modules/app/register.cc +++ b/modules/app/transactions.cc @@ -1,17 +1,11 @@ // Matrix Construct // // Copyright (C) Matrix Construct Developers, Authors & Contributors -// Copyright (C) 2016-2018 Jason Volk +// Copyright (C) 2016-2019 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. -using namespace ircd; - -mapi::header -IRCD_MODULE -{ - "2.1 :Application Services :Registration", -}; +#include "app.h"