summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2004-04-19 01:02:57 +0000
committerbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2004-04-19 01:02:57 +0000
commit7a51b2bed1cdc0e6c2522f2b2d10f3f787ff677d (patch)
treebe64a38b2f6837ef132619868864081010043f36
parentb53d255cf447acd55709f90bdd51949beaf0f94c (diff)
Moving yet more stuff into message.cpp
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@665 e03df62e-2008-0410-955e-edbf42e46eb7
-rw-r--r--include/inspircd.h1
-rw-r--r--include/message.h3
-rw-r--r--src/InspIRCd.layout18
-rw-r--r--src/inspircd.cpp72
-rw-r--r--src/message.cpp74
5 files changed, 86 insertions, 82 deletions
diff --git a/include/inspircd.h b/include/inspircd.h
index a5544d904..866c545d4 100644
--- a/include/inspircd.h
+++ b/include/inspircd.h
@@ -110,7 +110,6 @@ void force_nickchange(userrec* user,const char* newnick);
void kill_link(userrec *user,const char* r);
int usercount(chanrec *c);
void call_handler(const char* commandname,char **parameters, int pcnt, userrec *user);
-void send_network_quit(const char* nick, const char* reason);
long GetRevision();
// mesh network functions
diff --git a/include/message.h b/include/message.h
index 4958af0f1..cc9076bce 100644
--- a/include/message.h
+++ b/include/message.h
@@ -29,5 +29,8 @@ int isnick(const char* n);
char* cmode(userrec *user, chanrec *chan);
int cstatus(userrec *user, chanrec *chan);
int has_channel(userrec *u, chanrec *c);
+void TidyBan(char *ban);
+char* chlist(userrec *user);
+void send_network_quit(const char* nick, const char* reason);
#endif
diff --git a/src/InspIRCd.layout b/src/InspIRCd.layout
index ff4ff18e8..3f83568e9 100644
--- a/src/InspIRCd.layout
+++ b/src/InspIRCd.layout
@@ -13,9 +13,9 @@ LeftChar=1
[Editor_1]
Open=1
Top=0
-CursorCol=1
-CursorRow=1614
-TopLine=1600
+CursorCol=3
+CursorRow=3747
+TopLine=3701
LeftChar=1
[Editor_2]
@@ -142,8 +142,8 @@ LeftChar=1
Open=1
Top=0
CursorCol=1
-CursorRow=89
-TopLine=72
+CursorRow=113
+TopLine=71
LeftChar=1
[Editor_18]
@@ -303,13 +303,13 @@ LeftChar=1
Open=1
Top=1
CursorCol=1
-CursorRow=405
-TopLine=352
+CursorRow=483
+TopLine=429
LeftChar=1
[Editor_40]
Open=1
Top=0
-CursorCol=41
-CursorRow=31
+CursorCol=62
+CursorRow=34
TopLine=1
LeftChar=1
diff --git a/src/inspircd.cpp b/src/inspircd.cpp
index 99c9196c0..782e6a2fd 100644
--- a/src/inspircd.cpp
+++ b/src/inspircd.cpp
@@ -1920,32 +1920,6 @@ int take_voice(userrec *user,char *dest,chanrec *chan,int status)
return 1;
}
-void TidyBan(char *ban)
-{
- if (!ban) {
- log(DEFAULT,"*** BUG *** TidyBan was given an invalid parameter");
- return;
- }
-
- char temp[MAXBUF],NICK[MAXBUF],IDENT[MAXBUF],HOST[MAXBUF];
-
- strcpy(temp,ban);
-
- char* pos_of_pling = strchr(temp,'!');
- char* pos_of_at = strchr(temp,'@');
-
- pos_of_pling[0] = '\0';
- pos_of_at[0] = '\0';
- pos_of_pling++;
- pos_of_at++;
-
- strncpy(NICK,temp,NICKMAX);
- strncpy(IDENT,pos_of_pling,IDENTMAX+1);
- strncpy(HOST,pos_of_at,160);
-
- sprintf(ban,"%s!%s@%s",NICK,IDENT,HOST);
-}
-
int add_ban(userrec *user,char *dest,chanrec *chan,int status)
{
if ((!user) || (!dest) || (!chan)) {
@@ -4268,45 +4242,6 @@ void handle_notice(char **parameters, int pcnt, userrec *user)
}
}
-char lst[MAXBUF];
-
-char* chlist(userrec *user)
-{
- int i = 0;
- char cmp[MAXBUF];
-
- log(DEBUG,"chlist: %s",user->nick);
- strcpy(lst,"");
- if (!user)
- {
- return lst;
- }
- for (int i = 0; i != MAXCHANS; i++)
- {
- if (user->chans[i].channel != NULL)
- {
- if (user->chans[i].channel->name)
- {
- strcpy(cmp,user->chans[i].channel->name);
- strcat(cmp," ");
- if (!strstr(lst,cmp))
- {
- if ((!user->chans[i].channel->c_private) && (!user->chans[i].channel->secret))
- {
- strcat(lst,cmode(user,user->chans[i].channel));
- strcat(lst,user->chans[i].channel->name);
- strcat(lst," ");
- }
- }
- }
- }
- }
- if (strlen(lst))
- {
- lst[strlen(lst)-1] = '\0'; // chop trailing space
- }
- return lst;
-}
void handle_info(char **parameters, int pcnt, userrec *user)
{
@@ -4380,13 +4315,6 @@ void handle_whois(char **parameters, int pcnt, userrec *user)
}
}
-void send_network_quit(const char* nick, const char* reason)
-{
- char buffer[MAXBUF];
- snprintf(buffer,MAXBUF,"Q %s :%s",nick,reason);
- NetSendToAll(buffer);
-}
-
void handle_quit(char **parameters, int pcnt, userrec *user)
{
user_hash::iterator iter = clientlist.find(user->nick);
diff --git a/src/message.cpp b/src/message.cpp
index 2aba4908e..1c2bd4cf4 100644
--- a/src/message.cpp
+++ b/src/message.cpp
@@ -406,4 +406,78 @@ int has_channel(userrec *u, chanrec *c)
}
+void TidyBan(char *ban)
+{
+ if (!ban) {
+ log(DEFAULT,"*** BUG *** TidyBan was given an invalid parameter");
+ return;
+ }
+
+ char temp[MAXBUF],NICK[MAXBUF],IDENT[MAXBUF],HOST[MAXBUF];
+
+ strcpy(temp,ban);
+
+ char* pos_of_pling = strchr(temp,'!');
+ char* pos_of_at = strchr(temp,'@');
+
+ pos_of_pling[0] = '\0';
+ pos_of_at[0] = '\0';
+ pos_of_pling++;
+ pos_of_at++;
+
+ strncpy(NICK,temp,NICKMAX);
+ strncpy(IDENT,pos_of_pling,IDENTMAX+1);
+ strncpy(HOST,pos_of_at,160);
+
+ sprintf(ban,"%s!%s@%s",NICK,IDENT,HOST);
+}
+
+char lst[MAXBUF];
+
+char* chlist(userrec *user)
+{
+ int i = 0;
+ char cmp[MAXBUF];
+
+ log(DEBUG,"chlist: %s",user->nick);
+ strcpy(lst,"");
+ if (!user)
+ {
+ return lst;
+ }
+ for (int i = 0; i != MAXCHANS; i++)
+ {
+ if (user->chans[i].channel != NULL)
+ {
+ if (user->chans[i].channel->name)
+ {
+ strcpy(cmp,user->chans[i].channel->name);
+ strcat(cmp," ");
+ if (!strstr(lst,cmp))
+ {
+ if ((!user->chans[i].channel->c_private) && (!user->chans[i].channel->secret))
+ {
+ strcat(lst,cmode(user,user->chans[i].channel));
+ strcat(lst,user->chans[i].channel->name);
+ strcat(lst," ");
+ }
+ }
+ }
+ }
+ }
+ if (strlen(lst))
+ {
+ lst[strlen(lst)-1] = '\0'; // chop trailing space
+ }
+ return lst;
+}
+
+
+void send_network_quit(const char* nick, const char* reason)
+{
+ char buffer[MAXBUF];
+ snprintf(buffer,MAXBUF,"Q %s :%s",nick,reason);
+ NetSendToAll(buffer);
+}
+