summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2004-04-12 12:54:51 +0000
committerbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2004-04-12 12:54:51 +0000
commit642b665fb0967dc9dcbaed5f54b52276ea230e12 (patch)
tree9e6259b4e496c372826da36fc27bb772f157c3ff /src
parentf98a8569791abd5d021285871c93e7e3d7f04446 (diff)
Added 'a' amd 'b' server link tokens (change gecos, change host)
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@562 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src')
-rw-r--r--src/InspIRCd.layout50
-rw-r--r--src/inspircd.cpp69
-rw-r--r--src/modules.cpp10
3 files changed, 106 insertions, 23 deletions
diff --git a/src/InspIRCd.layout b/src/InspIRCd.layout
index d4d4bbaec..13c04b3b9 100644
--- a/src/InspIRCd.layout
+++ b/src/InspIRCd.layout
@@ -13,9 +13,9 @@ LeftChar=1
[Editor_1]
Open=1
Top=0
-CursorCol=6
-CursorRow=952
-TopLine=952
+CursorCol=12
+CursorRow=6593
+TopLine=6550
LeftChar=1
[Editor_2]
@@ -37,9 +37,9 @@ LeftChar=1
[Editor_4]
Open=1
Top=0
-CursorCol=26
-CursorRow=258
-TopLine=204
+CursorCol=1
+CursorRow=262
+TopLine=219
LeftChar=1
[Editor_5]
@@ -85,9 +85,9 @@ LeftChar=1
[Editor_10]
Open=1
Top=0
-CursorCol=31
-CursorRow=75
-TopLine=94
+CursorCol=1
+CursorRow=102
+TopLine=76
LeftChar=1
[Editor_11]
@@ -132,7 +132,7 @@ LeftChar=1
[Editor_16]
Open=1
-Top=1
+Top=0
CursorCol=6
CursorRow=32
TopLine=1
@@ -141,9 +141,9 @@ LeftChar=1
[Editor_17]
Open=1
Top=0
-CursorCol=6
-CursorRow=94
-TopLine=62
+CursorCol=47
+CursorRow=118
+TopLine=64
LeftChar=1
[Editor_18]
@@ -165,9 +165,9 @@ LeftChar=1
[Editor_20]
Open=1
Top=0
-CursorCol=36
-CursorRow=471
-TopLine=425
+CursorCol=6
+CursorRow=486
+TopLine=434
LeftChar=1
[Editor_21]
@@ -238,7 +238,7 @@ TopLine=1
LeftChar=1
[Editor_30]
Open=1
-Top=0
+Top=1
CursorCol=87
CursorRow=21
TopLine=1
@@ -258,20 +258,24 @@ CursorRow=1
TopLine=1
LeftChar=1
[Editor_33]
-Open=0
+Open=1
Top=0
+CursorCol=39
+CursorRow=36
+TopLine=1
+LeftChar=1
[Editor_34]
Open=1
Top=0
-CursorCol=1
-CursorRow=86
-TopLine=32
+CursorCol=38
+CursorRow=35
+TopLine=8
LeftChar=1
[Editor_35]
-Open=0
+Open=1
Top=0
CursorCol=1
-CursorRow=25
+CursorRow=29
TopLine=1
LeftChar=1
[Editor_36]
diff --git a/src/inspircd.cpp b/src/inspircd.cpp
index bd0198e5f..3929138d6 100644
--- a/src/inspircd.cpp
+++ b/src/inspircd.cpp
@@ -949,6 +949,42 @@ void WriteMode(const char* modes, int flags, const char* text, ...)
}
}
+void ChangeName(userrec* user, const char* gecos)
+{
+ strncpy(user->fullname,gecos,MAXBUF);
+ char buffer[MAXBUF];
+ snprintf(buffer,MAXBUF,"a %s :%s",user->nick,gecos);
+ for (int j = 0; j < 255; j++)
+ {
+ if (servers[j] != NULL)
+ {
+ if (strcmp(servers[j]->name,ServerName))
+ {
+ me[defaultRoute]->SendPacket(buffer,servers[j]->internal_addr,servers[j]->internal_port,MyKey);
+ log(DEBUG,"Sent a token");
+ }
+ }
+ }
+}
+
+void ChangeDisplayedHost(userrec* user, const char* host)
+{
+ strncpy(user->dhost,host,160);
+ char buffer[MAXBUF];
+ snprintf(buffer,MAXBUF,"b %s :%s",user->nick,host);
+ for (int j = 0; j < 255; j++)
+ {
+ if (servers[j] != NULL)
+ {
+ if (strcmp(servers[j]->name,ServerName))
+ {
+ me[defaultRoute]->SendPacket(buffer,servers[j]->internal_addr,servers[j]->internal_port,MyKey);
+ log(DEBUG,"Sent b token");
+ }
+ }
+ }
+}
+
void WriteWallOps(userrec *source, bool local_only, char* text, ...)
{
if ((!text) || (!source))
@@ -6443,6 +6479,29 @@ void handle_F(char token,char* params,serverrec* source,serverrec* reply, char*
WriteOpers("TS split for %s -> %s: %d",source->name,reply->name,tdiff);
}
+void handle_a(char token,char* params,serverrec* source,serverrec* reply, char* udp_host,int udp_port)
+{
+ char* nick = strtok(params," :");
+ char* gecos = strtok(NULL,"\r\n");
+
+ userrec* user = Find(nick);
+
+ if (user)
+ strncpy(user->fullname,gecos,MAXBUF);
+}
+
+void handle_b(char token,char* params,serverrec* source,serverrec* reply, char* udp_host,int udp_port)
+{
+ char* nick = strtok(params," :");
+ char* host = strtok(NULL,"\r\n");
+
+ userrec* user = Find(nick);
+
+ if (user)
+ strncpy(user->dhost,host,160);
+}
+
+
void handle_J(char token,char* params,serverrec* source,serverrec* reply, char* udp_host,int udp_port)
{
// IMPORTANT NOTE
@@ -6523,6 +6582,16 @@ void process_restricted_commands(char token,char* params,serverrec* source,serve
case 'N':
handle_N(token,params,source,reply,udp_host,udp_port);
break;
+ // a <NICK> :<GECOS>
+ // change GECOS (SETNAME)
+ case 'a':
+ handle_a(token,params,source,reply,udp_host,udp_port);
+ break;
+ // b <NICK> :<HOST>
+ // change displayed host (SETHOST)
+ case 'b':
+ handle_b(token,params,source,reply,udp_host,udp_port);
+ break;
// t <NICK> <CHANNEL> :<TOPIC>
// change a channel topic
case 't':
diff --git a/src/modules.cpp b/src/modules.cpp
index 1ff2f3f9d..472c6ca9e 100644
--- a/src/modules.cpp
+++ b/src/modules.cpp
@@ -258,6 +258,16 @@ void Server::SendWallops(userrec* User, std::string text)
WriteWallOps(User,false,"%s",text.c_str());
}
+void Server::ChangeHost(userrec* user, std::string host)
+{
+ ChangeDisplayedHost(user,host.c_str());
+}
+
+void Server::ChangeGECOS(userrec* user, std::string gecos)
+{
+ ChangeName(user,gecos.c_str());
+}
+
bool Server::IsNick(std::string nick)
{
return (isnick(nick.c_str()) != 0);