From 118efe5cc7203d401761d31726e04966e887fe4f Mon Sep 17 00:00:00 2001
From: Jason Volk <jason@zemos.net>
Date: Thu, 22 Aug 2019 02:38:29 -0700
Subject: [PATCH] ircd::m::room::state: Remove cruft.

---
 include/ircd/m/room/state.h |  1 -
 ircd/m_room.cc              | 33 ---------------------------------
 modules/console.cc          | 27 ---------------------------
 3 files changed, 61 deletions(-)

diff --git a/include/ircd/m/room/state.h b/include/ircd/m/room/state.h
index 5defe28e7..e0cc63c70 100644
--- a/include/ircd/m/room/state.h
+++ b/include/ircd/m/room/state.h
@@ -98,7 +98,6 @@ struct ircd::m::room::state
 	static size_t prefetch(const state &, const string_view &, const event::idx_range &);
 	static bool present(const event::idx &);
 	static size_t rebuild_present(const room::id &);
-	static bool force_present(const event &);
 	static size_t purge_replaced(const room::id &);
 	static bool is(std::nothrow_t, const event::idx &);
 	static bool is(const event::idx &);
diff --git a/ircd/m_room.cc b/ircd/m_room.cc
index 82bfb684e..100ba0324 100644
--- a/ircd/m_room.cc
+++ b/ircd/m_room.cc
@@ -95,39 +95,6 @@ ircd::m::room::state::purge_replaced(const room::id &room_id)
 	return ret;
 }
 
-bool
-ircd::m::room::state::force_present(const m::event &event)
-{
-	db::txn txn
-	{
-		*m::dbs::events
-	};
-
-	if(!defined(json::get<"room_id"_>(event)))
-		throw error
-		{
-			"event %s is not a room event (no room_id)",
-			string_view{event.event_id}
-		};
-
-	if(!defined(json::get<"state_key"_>(event)))
-		throw error
-		{
-			"event %s is not a state event (no state_key)",
-			string_view{event.event_id}
-		};
-
-	dbs::write_opts opts;
-	opts.event_idx = m::index(event);
-	opts.appendix.reset();
-	opts.appendix.set(dbs::appendix::ROOM_STATE);
-	opts.appendix.reset(dbs::appendix::ROOM_JOINED);
-	dbs::write(txn, event, opts);
-
-	txn();
-	return true;
-}
-
 size_t
 ircd::m::room::state::rebuild_present(const room::id &room_id)
 {
diff --git a/modules/console.cc b/modules/console.cc
index 394a01c1e..84c86aa8d 100644
--- a/modules/console.cc
+++ b/modules/console.cc
@@ -9171,33 +9171,6 @@ console_cmd__room__state__space__rebuild(opt &out, const string_view &line)
 	return true;
 }
 
-bool
-console_cmd__room__state__force(opt &out, const string_view &line)
-{
-	const params param{line, " ",
-	{
-		"event_id"
-	}};
-
-	const m::event::id &event_id
-	{
-		param.at(0)
-	};
-
-	const m::event::fetch event
-	{
-		event_id
-	};
-
-	const auto res
-	{
-		m::room::state::force_present(event)
-	};
-
-	out << "forced " << event_id << " into present state" << std::endl;
-	return true;
-}
-
 bool
 console_cmd__room__state__purge__replaced(opt &out, const string_view &line)
 {