[BUGFIX] init notify with debug
This commit is contained in:
parent
be29dede66
commit
5f9ad29483
|
@ -90,9 +90,10 @@ func (db *DB) NewNotify(to string) *Notify {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
n := &Notify{
|
n := &Notify{
|
||||||
Protocol: addr[0],
|
Protocol: addr[0],
|
||||||
To: addr[1],
|
To: addr[1],
|
||||||
RegexIn: make(map[string]*regexp.Regexp),
|
RegexIn: make(map[string]*regexp.Regexp),
|
||||||
|
MaxPrioIn: log.DebugLevel,
|
||||||
}
|
}
|
||||||
db.AddNotify(n)
|
db.AddNotify(n)
|
||||||
return n
|
return n
|
||||||
|
|
|
@ -46,8 +46,10 @@ func Init(configInterface interface{}, db *database.DB, bot *bot.Bot) output.Out
|
||||||
var defaults []*database.Notify
|
var defaults []*database.Notify
|
||||||
if config.Default != "" {
|
if config.Default != "" {
|
||||||
defaults = append(defaults, &database.Notify{
|
defaults = append(defaults, &database.Notify{
|
||||||
Protocol: proto,
|
Protocol: proto,
|
||||||
To: config.Default,
|
To: config.Default,
|
||||||
|
RegexIn: make(map[string]*regexp.Regexp),
|
||||||
|
MaxPrioIn: log.DebugLevel,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -2,6 +2,7 @@ package xmpp
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"net/http"
|
"net/http"
|
||||||
|
"regexp"
|
||||||
|
|
||||||
"dev.sum7.eu/genofire/golang-lib/websocket"
|
"dev.sum7.eu/genofire/golang-lib/websocket"
|
||||||
"github.com/mitchellh/mapstructure"
|
"github.com/mitchellh/mapstructure"
|
||||||
|
@ -57,8 +58,10 @@ func Init(configInterface interface{}, db *database.DB, bot *bot.Bot) output.Out
|
||||||
var defaults []*database.Notify
|
var defaults []*database.Notify
|
||||||
if config.Default != "" {
|
if config.Default != "" {
|
||||||
defaults = append(defaults, &database.Notify{
|
defaults = append(defaults, &database.Notify{
|
||||||
Protocol: proto,
|
Protocol: proto,
|
||||||
To: config.Default,
|
To: config.Default,
|
||||||
|
RegexIn: make(map[string]*regexp.Regexp),
|
||||||
|
MaxPrioIn: log.DebugLevel,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
return &Output{
|
return &Output{
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
package xmpp
|
package xmpp
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"regexp"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
xmpp_client "dev.sum7.eu/genofire/yaja/client"
|
xmpp_client "dev.sum7.eu/genofire/yaja/client"
|
||||||
|
@ -148,8 +149,10 @@ func Init(configInterface interface{}, db *database.DB, bot *bot.Bot) output.Out
|
||||||
|
|
||||||
for to, muc := range config.Defaults {
|
for to, muc := range config.Defaults {
|
||||||
def := &database.Notify{
|
def := &database.Notify{
|
||||||
Protocol: proto,
|
Protocol: proto,
|
||||||
To: to,
|
To: to,
|
||||||
|
RegexIn: make(map[string]*regexp.Regexp),
|
||||||
|
MaxPrioIn: log.DebugLevel,
|
||||||
}
|
}
|
||||||
if muc {
|
if muc {
|
||||||
def.Protocol = protoGroup
|
def.Protocol = protoGroup
|
||||||
|
|
Loading…
Reference in New Issue