summaryrefslogtreecommitdiff
path: root/src/modules/m_helpop.cpp
diff options
context:
space:
mode:
authorbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2006-08-11 00:46:41 +0000
committerbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2006-08-11 00:46:41 +0000
commitfd6ee21f2f55875984884a8413d61012e066029f (patch)
treeff9feeffe5ddac50d30db1e44656cc9d2dc2e216 /src/modules/m_helpop.cpp
parent66098d307c036997e51eaea21724615e27fdc3e9 (diff)
None of the modules use an extern InspIRCd* any more
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@4863 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src/modules/m_helpop.cpp')
-rw-r--r--src/modules/m_helpop.cpp84
1 files changed, 41 insertions, 43 deletions
diff --git a/src/modules/m_helpop.cpp b/src/modules/m_helpop.cpp
index 4d4263d28..452a7114b 100644
--- a/src/modules/m_helpop.cpp
+++ b/src/modules/m_helpop.cpp
@@ -25,7 +25,7 @@ using namespace std;
// Global Vars
static ConfigReader *helpop;
-extern InspIRCd* ServerInstance;
+
bool do_helpop(const char**, int, userrec*);
void sendtohelpop(userrec*, int, const char**);
@@ -127,60 +127,58 @@ class cmd_helpop : public command_t
}
}
}
-};
-bool do_helpop(const char** parameters, int pcnt, userrec *src)
-{
- char search[MAXBUF];
- std::string output = " "; // a fix bought to you by brain :p
- char a[MAXBUF];
- int nlines = 0;
-
- if (!pcnt)
+ bool do_helpop(const char** parameters, int pcnt, userrec *src)
{
- strcpy(search,"start");
- }
- else
- {
- if (*parameters[0] == '?')
- parameters[0]++;
- strlcpy(search,parameters[0],MAXBUF);
- }
+ char search[MAXBUF];
+ std::string output = " "; // a fix bought to you by brain :p
+ char a[MAXBUF];
+ int nlines = 0;
- for (char* n = search; *n; n++)
- *n = tolower(*n);
+ if (!pcnt)
+ {
+ strcpy(search,"start");
+ }
+ else
+ {
+ if (*parameters[0] == '?')
+ parameters[0]++;
+ strlcpy(search,parameters[0],MAXBUF);
+ }
- for (int i = 1; output != ""; i++)
- {
- snprintf(a,MAXBUF,"line%d",i);
- output = helpop->ReadValue(search, a, 0);
- if (output != "")
+ for (char* n = search; *n; n++)
+ *n = tolower(*n);
+
+ for (int i = 1; output != ""; i++)
{
- src->WriteServ("290 "+std::string(src->nick)+" :"+output);
- nlines++;
+ snprintf(a,MAXBUF,"line%d",i);
+ output = helpop->ReadValue(search, a, 0);
+ if (output != "")
+ {
+ src->WriteServ("290 "+std::string(src->nick)+" :"+output);
+ nlines++;
+ }
}
+ return (nlines>0);
}
- return (nlines>0);
-}
-
-
-void sendtohelpop(userrec *src, int pcnt, const char **params)
-{
- const char* first = params[0];
- if (*first == '!')
+ void sendtohelpop(userrec *src, int pcnt, const char **params)
{
- first++;
- }
+ const char* first = params[0];
+ if (*first == '!')
+ {
+ first++;
+ }
- std::string line = "*** HELPOPS - From "+std::string(src->nick)+": "+std::string(first)+" ";
- for (int i = 1; i < pcnt; i++)
- {
- line = line + std::string(params[i]) + " ";
+ std::string line = "*** HELPOPS - From "+std::string(src->nick)+": "+std::string(first)+" ";
+ for (int i = 1; i < pcnt; i++)
+ {
+ line = line + std::string(params[i]) + " ";
+ }
+ ServerInstance->WriteMode("oh",WM_AND,line.c_str());
}
- ServerInstance->WriteMode("oh",WM_AND,line.c_str());
-}
+};
class HelpopException : public ModuleException
{