forked from lesderid/salty-ircd
Implement VERSION
This commit is contained in:
parent
5c67c483ab
commit
cfc1345682
|
@ -165,6 +165,10 @@ class Connection
|
|||
if(!registered) sendErrNotRegistered();
|
||||
else onInvite(message);
|
||||
break;
|
||||
case "VERSION":
|
||||
if(!registered) sendErrNotRegistered();
|
||||
else onVersion(message);
|
||||
break;
|
||||
default:
|
||||
writeln("unknown command '", message.command, "'");
|
||||
send(Message(_server.name, "421", [nick, message.command, "Unknown command"]));
|
||||
|
@ -569,6 +573,16 @@ class Connection
|
|||
}
|
||||
}
|
||||
|
||||
void onVersion(Message message)
|
||||
{
|
||||
if(message.parameters.length > 0)
|
||||
{
|
||||
notImplemented("querying the version of another server");
|
||||
return;
|
||||
}
|
||||
_server.sendVersion(this);
|
||||
}
|
||||
|
||||
void sendWhoReply(string channel, Connection user, uint hopCount)
|
||||
{
|
||||
auto flags = user.modes.canFind('a') ? "G" : "H";
|
||||
|
|
|
@ -251,6 +251,11 @@ class Server
|
|||
connection.sendRplListEnd();
|
||||
}
|
||||
|
||||
void sendVersion(Connection connection)
|
||||
{
|
||||
connection.send(Message(name, "351", [connection.nick, versionString ~ ".", name, ""], true));
|
||||
}
|
||||
|
||||
void invite(Connection inviter, string target, string channelName)
|
||||
{
|
||||
auto user = connections.find!(c => c.nick = target)[0];
|
||||
|
|
Loading…
Reference in New Issue