forked from External/ergo
invite command
This commit is contained in:
parent
d6ec1e719b
commit
f0305cf01a
4 changed files with 66 additions and 5 deletions
|
|
@ -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)
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue