1
0
Fork 0
forked from External/ergo

invite command

This commit is contained in:
Jeremy Latt 2014-02-25 07:28:09 -08:00
parent d6ec1e719b
commit f0305cf01a
4 changed files with 66 additions and 5 deletions

View file

@ -448,7 +448,7 @@ func (msg *PrivMsgCommand) HandleServer(server *Server) {
}
target.Reply(RplPrivMsg(client, target, msg.message))
if target.flags[Away] {
target.RplAway(client)
client.RplAway(target)
}
}
@ -772,3 +772,22 @@ func (msg *VersionCommand) HandleServer(server *Server) {
client.RplVersion()
}
func (msg *InviteCommand) HandleServer(server *Server) {
client := msg.Client()
target := server.clients.Get(msg.nickname)
if target == nil {
client.ErrNoSuchNick(msg.nickname)
return
}
channel := server.channels[msg.channel]
if channel == nil {
client.RplInviting(target, msg.channel)
target.Reply(RplInviteMsg(client, msg.channel))
return
}
channel.Invite(target, client)
}