aboutsummaryrefslogtreecommitdiffstats
path: root/src/modules
diff options
context:
space:
mode:
authorGravatar Sadie Powell2022-01-31 02:04:43 +0000
committerGravatar Sadie Powell2022-01-31 12:01:39 +0000
commit7d3055f8c3908da493d29191b175be3f810ff05b (patch)
tree0d8def0a5c9452be28121f5f3e930b3f3010b1af /src/modules
parentRename the ExtensionItem::type field to extype to avoid collisions. (diff)
Add the type to the Extensible class.
Diffstat (limited to 'src/modules')
-rw-r--r--src/modules/m_spanningtree/main.cpp5
-rw-r--r--src/modules/m_swhois.cpp5
2 files changed, 4 insertions, 6 deletions
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<User*>(target);
- if (dest && (extname == "uniqueusername"))
- dest->uniqueusername = (extdata != "0");
+ if (target->extype == ExtensionType::USER && irc::equals(extname, "uniqueusername"))
+ static_cast<User*>(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<User*>(target);
- if (dest && (extname == "swhois"))
- cmd.operblock.Unset(dest);
+ if (target->extype == ExtensionType::USER && irc::equals(extname, "swhois"))
+ cmd.operblock.Unset(static_cast<User*>(target));
}
};