]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/modules/m_safelist.cpp
Fixes and removal of Server::GetServerName()
[user/henk/code/inspircd.git] / src / modules / m_safelist.cpp
index 45177805ec9790975938d7fc3817086e01caa380..091d59d1a7313e171304a170a3bb1d6a5bffe8c8 100644 (file)
@@ -22,10 +22,13 @@ using namespace std;
 #include "helperfuncs.h"
 #include "message.h"
 #include <vector>
+#include "configreader.h"
 #include "inspircd.h"
 
 extern time_t TIME;
 
+extern InspIRCd* ServerInstance;
+
 class ListData : public classbase
 {
  public:
@@ -105,9 +108,9 @@ class ListTimer : public InspTimer
                                                long users = chan->GetUserCounter();
                                                if (users)
                                                {
-                                                       int counter = snprintf(buffer,MAXBUF,"322 %s %s %ld :[+%s] %s",u->nick,chan->name,users,chanmodes(chan,has_user),chan->topic);
+                                                       int counter = snprintf(buffer,MAXBUF,"322 %s %s %ld :[+%s] %s",u->nick,chan->name,users,chan->ChanModes(has_user),chan->topic);
                                                        /* Increment total plus linefeed */
-                                                       amount_sent += counter + 4 + Srv->GetServerName().length();
+                                                       amount_sent += counter + 4 + strlen(ServerInstance->Config->ServerName);
                                                        log(DEBUG,"m_safelist.so: Sent %ld of safe %ld / 4",amount_sent,u->sendqmax);
                                                        u->WriteServ(std::string(buffer));
                                                }
@@ -131,7 +134,7 @@ class ListTimer : public InspTimer
                }
 
                ListTimer* MyTimer = new ListTimer(1,Srv);
-               Srv->AddTimer(MyTimer);
+               ServerInstance->Timers->AddTimer(MyTimer);
        }
 };
 
@@ -146,7 +149,7 @@ class ModuleSafeList : public Module
                Srv = Me;
 
                MyTimer = new ListTimer(1,Srv);
-               Srv->AddTimer(MyTimer);
+               ServerInstance->Timers->AddTimer(MyTimer);
        }
  
        virtual ~ModuleSafeList()