summaryrefslogtreecommitdiff
path: root/src/modules
diff options
context:
space:
mode:
authorbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2005-12-05 08:59:26 +0000
committerbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2005-12-05 08:59:26 +0000
commit14ada0cad90860d02bea16970d51fdc1f7bea3de (patch)
treef4ad1c7a8f29a040de8ae2cea93e6f4131f2f3f4 /src/modules
parentace0f7f83f3322cc3b251835c7a44d63c8d8acb3 (diff)
Added FNAME and FHOST
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@2182 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src/modules')
-rw-r--r--src/modules/m_spanningtree.cpp51
1 files changed, 51 insertions, 0 deletions
diff --git a/src/modules/m_spanningtree.cpp b/src/modules/m_spanningtree.cpp
index edbb3506b..f33149be2 100644
--- a/src/modules/m_spanningtree.cpp
+++ b/src/modules/m_spanningtree.cpp
@@ -928,6 +928,33 @@ class TreeSocket : public InspSocket
DoOneToAllButSender(prefix,"VERSION",params,prefix);
return true;
}
+
+ bool ChangeHost(std::string prefix, std::deque<std::string> params)
+ {
+ if (params.size() < 1)
+ return true;
+ userrec* u = Srv->FindNick(prefix);
+ if (u)
+ {
+ Srv->ChangeHost(u,params[0]);
+ }
+ DoOneToAllButSender(prefix,"FHOST",params,prefix);
+ return true;
+ }
+
+ bool ChangeName(std::string prefix, std::deque<std::string> params)
+ {
+ if (params.size() < 1)
+ return true;
+ userrec* u = Srv->FindNick(prefix);
+ if (u)
+ {
+ Srv->ChangeGECOS(u,params[0]);
+ }
+ params[0] = ":" + params[0];
+ DoOneToAllButSender(prefix,"FNAME",params,prefix);
+ return true;
+ }
bool LocalPing(std::string prefix, std::deque<std::string> params)
{
@@ -1245,6 +1272,14 @@ class TreeSocket : public InspSocket
{
return this->ServerVersion(prefix,params);
}
+ else if (command == "FHOST")
+ {
+ return this->ChangeHost(prefix,params);
+ }
+ else if (command == "FNAME")
+ {
+ return this->ChangeName(prefix,params);
+ }
else if (command == "SQUIT")
{
if (params.size() == 2)
@@ -2000,6 +2035,22 @@ class ModuleSpanningTree : public Module
}
}
+ virtual void OnChangeHost(userrec* user, std::string newhost)
+ {
+ // only occurs for local clients
+ std::deque<std::string> params;
+ params.push_back(newhost);
+ DoOneToMany(user->nick,"FHOST",params);
+ }
+
+ virtual void OnChangeName(userrec* user, std::string gecos)
+ {
+ // only occurs for local clients
+ std::deque<std::string> params;
+ params.push_back(gecos);
+ DoOneToMany(user->nick,"FNAME",params);
+ }
+
virtual void OnUserPart(userrec* user, chanrec* channel)
{
if (std::string(user->server) == Srv->GetServerName())