summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/modules/m_spanningtree.cpp17
1 files changed, 13 insertions, 4 deletions
diff --git a/src/modules/m_spanningtree.cpp b/src/modules/m_spanningtree.cpp
index 9f02af689..f14cc69de 100644
--- a/src/modules/m_spanningtree.cpp
+++ b/src/modules/m_spanningtree.cpp
@@ -3923,12 +3923,21 @@ class ModuleSpanningTree : public Module
if (params->size() < 2)
return;
// Insert the TS value of the object, either userrec or chanrec
- classbase* a = reinterpret_cast<classbase*>(Srv->FindNick((*params)[0]));
- if (!a)
+ time_t ourTS = 0;
+ userrec* a = Srv->FindNick((*params)[0]);
+ if (a)
{
- a = reinterpret_cast<classbase*>(Srv->FindChannel((*params)[0]));
+ ourTS = a->age;
+ }
+ else
+ {
+ chanrec* a = Srv->FindChannel((*params)[0]);
+ if (a)
+ {
+ ourTS = a->age;
+ }
}
- params->insert(params->begin() + 1,ConvToStr(a->age));
+ params->insert(params->begin() + 1,ConvToStr(ourTS));
DoOneToMany(Srv->GetServerName(),"FMODE",*params);
}
}