1 /* +------------------------------------+
2 * | Inspire Internet Relay Chat Daemon |
3 * +------------------------------------+
5 * InspIRCd: (C) 2002-2010 InspIRCd Development Team
6 * See: http://wiki.inspircd.org/Credits
8 * This program is free but copyrighted software; see
9 * the file COPYING for details.
11 * ---------------------------------------------------
17 #include "treesocket.h"
18 #include "treeserver.h"
21 CmdResult CommandMetadata::Handle(const std::vector<std::string>& params, User *srcuser)
23 std::string value = params.size() < 3 ? "" : params[2];
24 ExtensionItem* item = ServerInstance->Extensions.GetItem(params[1]);
27 FOREACH_MOD(I_OnDecodeMetaData,OnDecodeMetaData(NULL,params[1],value));
29 else if (*(params[0].c_str()) == '#')
31 Channel* c = ServerInstance->FindChan(params[0]);
35 item->unserialize(FORMAT_NETWORK, c, value);
36 FOREACH_MOD(I_OnDecodeMetaData,OnDecodeMetaData(c,params[1],value));
39 else if (*(params[0].c_str()) != '#')
41 User* u = ServerInstance->FindNick(params[0]);
45 item->unserialize(FORMAT_NETWORK, u, value);
46 FOREACH_MOD(I_OnDecodeMetaData,OnDecodeMetaData(u,params[1],value));