From 7d3055f8c3908da493d29191b175be3f810ff05b Mon Sep 17 00:00:00 2001 From: Sadie Powell Date: Mon, 31 Jan 2022 02:04:43 +0000 Subject: Add the type to the Extensible class. --- src/modules/m_spanningtree/main.cpp | 5 ++--- src/modules/m_swhois.cpp | 5 ++--- 2 files changed, 4 insertions(+), 6 deletions(-) (limited to 'src/modules') diff --git a/src/modules/m_spanningtree/main.cpp b/src/modules/m_spanningtree/main.cpp index 70005841f..98dda1800 100644 --- a/src/modules/m_spanningtree/main.cpp +++ b/src/modules/m_spanningtree/main.cpp @@ -851,9 +851,8 @@ void ModuleSpanningTree::OnShutdown(const std::string& reason) void ModuleSpanningTree::OnDecodeMetaData(Extensible* target, const std::string& extname, const std::string& extdata) { // HACK: this should use automatically synced user metadata in v4. - User* dest = static_cast(target); - if (dest && (extname == "uniqueusername")) - dest->uniqueusername = (extdata != "0"); + if (target->extype == ExtensionType::USER && irc::equals(extname, "uniqueusername")) + static_cast(target)->uniqueusername = (extdata != "0"); } Cullable::Result ModuleSpanningTree::Cull() diff --git a/src/modules/m_swhois.cpp b/src/modules/m_swhois.cpp index f6d65cf87..9623c8fb1 100644 --- a/src/modules/m_swhois.cpp +++ b/src/modules/m_swhois.cpp @@ -143,9 +143,8 @@ public: void OnDecodeMetaData(Extensible* target, const std::string& extname, const std::string&) override { - User* dest = static_cast(target); - if (dest && (extname == "swhois")) - cmd.operblock.Unset(dest); + if (target->extype == ExtensionType::USER && irc::equals(extname, "swhois")) + cmd.operblock.Unset(static_cast(target)); } }; -- cgit v1.3.1-10-gc9f91