diff options
Diffstat (limited to 'src/inspircd.cpp')
-rw-r--r-- | src/inspircd.cpp | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/src/inspircd.cpp b/src/inspircd.cpp index 59256f8c0..2671de21b 100644 --- a/src/inspircd.cpp +++ b/src/inspircd.cpp @@ -2746,6 +2746,12 @@ void handle_version(char **parameters, int pcnt, userrec *user) } else { + if (match(ServerName,parameters[0])) + { + WriteServ(user->fd,"351 %s :%s",user->nick,GetVersionString().c_str()); + return; + } + bool displayed = false, found = false; for (int j = 0; j < 32; j++) { if (me[j] != NULL) @@ -2754,12 +2760,21 @@ void handle_version(char **parameters, int pcnt, userrec *user) { if (match(me[j]->connectors[x].GetServerName().c_str(),parameters[0])) { - WriteServ(user->fd,"351 %s :%s",user->nick,me[j]->connectors[x].GetVersionString().c_str()); - return; + found = true; + if ((me[j]->connectors[x].GetVersionString() != "") && (!displayed)) + { + displayed = true; + WriteServ(user->fd,"351 %s :%s",user->nick,me[j]->connectors[x].GetVersionString().c_str()); + } } } } } + if ((!displayed) && (found)) + { + WriteServ(user->fd,"402 %s %s :Server %s has no version information",user->nick,parameters[0],parameters[0]); + return; + } WriteServ(user->fd,"402 %s %s :No such server",user->nick,parameters[0]); } return; |