summaryrefslogtreecommitdiff
path: root/src/modules.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/modules.cpp')
-rw-r--r--src/modules.cpp28
1 files changed, 28 insertions, 0 deletions
diff --git a/src/modules.cpp b/src/modules.cpp
index 324ab375c..2b4314dee 100644
--- a/src/modules.cpp
+++ b/src/modules.cpp
@@ -576,6 +576,34 @@ int Server::CountUsers(chanrec* c)
}
+bool Server::UserToPseudo(userrec* user,std::string message)
+{
+ unsigned int old_fd = user->fd;
+ user->fd = FD_MAGIC_NUMBER;
+ Write(old_fd,"ERROR :Closing link (%s@%s) [%s]",user->ident,user->host,message.c_str());
+ close(old_fd);
+ shutdown (old_fd,2);
+}
+
+bool Server::PseudoToUser(userrec* alive,userrec* zombie,std::string message)
+{
+ zombie->fd = alive->fd;
+ alive->fd = FD_MAGIC_NUMBER;
+ Write(zombie->fd,"NICK %s",zombie->nick);
+ kill_link(alive,message.c_str());
+ for (int i = 0; i != MAXCHANS; i++)
+ {
+ if (zombie->chans[i].channel != NULL)
+ {
+ if (zombie->chans[i].channel->name)
+ {
+ Write(zombie->fd,"JOIN %s",zombie->chans[i].channel->name);
+ }
+ }
+ }
+
+}
+
ConfigReader::ConfigReader()
{
this->cache = new std::stringstream(std::stringstream::in | std::stringstream::out);