Merge pull request #14 from arachnist/identify

Check on demand if person is identified.
configurable-file-paths
Robert S. Gerus 2015-11-23 19:35:29 +01:00
commit 2145c7d276
1 changed files with 19 additions and 1 deletions

View File

@ -13,6 +13,24 @@ import (
var identified map[string]map[string]string
func IsIdentified(msg irc.Message) bool {
if msg.Prefix == nil {
return false
}
if identified == nil {
return false
}
net := msg.Context["Network"]
if identified[net] == nil {
return false
}
if identified[net][msg.Prefix.Name] == "" {
return false
}
return true
}
func identify(output chan irc.Message, msg irc.Message) {
if strings.Split(msg.Trailing, " ")[0] != ":identify" {
return
@ -43,7 +61,7 @@ func listIdentified(output chan irc.Message, msg irc.Message) {
return
}
if cfg.Lookup(msg.Context, "AccessLevel").(int) < 10 {
if cfg.LookupInt(msg.Context, "AccessLevel") < 10 {
output <- reply(msg, "access denied")
return
}