Add auto_ctcp config option
This commit is contained in:
parent
fcf0c17682
commit
2ea4584c97
6 changed files with 17 additions and 5 deletions
|
@ -25,6 +25,8 @@ type Config struct {
|
|||
Account string
|
||||
Password string
|
||||
|
||||
// Automatically reply to common CTCP messages
|
||||
AutoCTCP bool
|
||||
// Version is the reply to VERSION and FINGER CTCP messages
|
||||
Version string
|
||||
// Source is the reply to SOURCE CTCP messages
|
||||
|
|
|
@ -58,8 +58,10 @@ func (c *Client) handleMessage(msg *Message) {
|
|||
msg.meta = c.state.renameUser(msg.Sender, msg.LastParam())
|
||||
|
||||
case PRIVMSG:
|
||||
if ctcp := msg.ToCTCP(); ctcp != nil {
|
||||
c.handleCTCP(ctcp, msg)
|
||||
if c.Config.AutoCTCP {
|
||||
if ctcp := msg.ToCTCP(); ctcp != nil {
|
||||
c.handleCTCP(ctcp, msg)
|
||||
}
|
||||
}
|
||||
|
||||
case MODE:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue