X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=src%2Fmodules%2Fm_spanningtree%2Fmetadata.cpp;h=52267c522923a7fb80ae49fac543f75385e2954e;hb=dccf47d0a091be2395257d401f8ed55eaa258bc7;hp=d151bc4501a8c1e7bf9f60a18396c3aeb74f256f;hpb=3eb205218a321e454d873ae14e2e717ce9d64142;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/src/modules/m_spanningtree/metadata.cpp b/src/modules/m_spanningtree/metadata.cpp index d151bc450..52267c522 100644 --- a/src/modules/m_spanningtree/metadata.cpp +++ b/src/modules/m_spanningtree/metadata.cpp @@ -21,7 +21,7 @@ #include "inspircd.h" #include "commands.h" -CmdResult CommandMetadata::Handle(User* srcuser, std::vector& params) +CmdResult CommandMetadata::Handle(User* srcuser, Params& params) { if (params[0] == "*") { @@ -41,10 +41,7 @@ CmdResult CommandMetadata::Handle(User* srcuser, std::vector& param if (!c) return CMD_FAILURE; - time_t ChanTS = ConvToInt(params[1]); - if (!ChanTS) - return CMD_INVALID; - + time_t ChanTS = ServerCommand::ExtractTS(params[1]); if (c->age < ChanTS) // Their TS is newer than ours, discard this command and do not propagate return CMD_FAILURE; @@ -52,19 +49,19 @@ CmdResult CommandMetadata::Handle(User* srcuser, std::vector& param std::string value = params.size() < 4 ? "" : params[3]; ExtensionItem* item = ServerInstance->Extensions.GetItem(params[2]); - if (item) + if ((item) && (item->type == ExtensionItem::EXT_CHANNEL)) item->unserialize(FORMAT_NETWORK, c, value); FOREACH_MOD(OnDecodeMetaData, (c,params[2],value)); } else { User* u = ServerInstance->FindUUID(params[0]); - if ((u) && (!IS_SERVER(u))) + if (u) { ExtensionItem* item = ServerInstance->Extensions.GetItem(params[1]); std::string value = params.size() < 3 ? "" : params[2]; - if (item) + if ((item) && (item->type == ExtensionItem::EXT_USER)) item->unserialize(FORMAT_NETWORK, u, value); FOREACH_MOD(OnDecodeMetaData, (u,params[1],value)); }