mirror of
https://github.com/ergochat/ergo.git
synced 2024-11-29 07:29:31 +01:00
stub motd
This commit is contained in:
parent
887f12cb31
commit
cdae59ecf5
@ -156,11 +156,13 @@ func (client *Client) Destroy() error {
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (client *Client) Reply(reply Reply) error {
|
func (client *Client) Reply(replies ...Reply) error {
|
||||||
if client.replies == nil {
|
if client.replies == nil {
|
||||||
return ErrAlreadyDestroyed
|
return ErrAlreadyDestroyed
|
||||||
}
|
}
|
||||||
client.replies <- reply
|
for _, reply := range replies {
|
||||||
|
client.replies <- reply
|
||||||
|
}
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -349,3 +349,7 @@ func ErrChanOPrivIsNeeded(channel *Channel) Reply {
|
|||||||
return NewNumericReply(channel.server, ERR_CHANOPRIVSNEEDED,
|
return NewNumericReply(channel.server, ERR_CHANOPRIVSNEEDED,
|
||||||
"%s :You're not channel operator", channel.name)
|
"%s :You're not channel operator", channel.name)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func ErrNoMOTD(server *Server) Reply {
|
||||||
|
return NewNumericReply(server, ERR_NOMOTD, ":MOTD File is missing")
|
||||||
|
}
|
||||||
|
@ -142,18 +142,19 @@ func (s *Server) GenerateGuestNick() string {
|
|||||||
func (s *Server) tryRegister(c *Client) {
|
func (s *Server) tryRegister(c *Client) {
|
||||||
if !c.registered && c.HasNick() && c.HasUsername() {
|
if !c.registered && c.HasNick() && c.HasUsername() {
|
||||||
c.registered = true
|
c.registered = true
|
||||||
replies := []Reply{
|
c.Reply(
|
||||||
RplWelcome(s, c),
|
RplWelcome(s, c),
|
||||||
RplYourHost(s),
|
RplYourHost(s),
|
||||||
RplCreated(s),
|
RplCreated(s),
|
||||||
RplMyInfo(s),
|
RplMyInfo(s))
|
||||||
}
|
server.MOTD(c)
|
||||||
for _, reply := range replies {
|
|
||||||
c.Reply(reply)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (server *Server) MOTD(client *Client) {
|
||||||
|
c.Reply(ErrNoMOTD(server))
|
||||||
|
}
|
||||||
|
|
||||||
func (s *Server) Id() string {
|
func (s *Server) Id() string {
|
||||||
return s.name
|
return s.name
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user