#475 delete .gitignore and getBoolOrDefault function
This commit is contained in:
2
.gitignore
vendored
2
.gitignore
vendored
@@ -1,2 +0,0 @@
|
||||
matterbridge.toml
|
||||
|
||||
@@ -88,17 +88,6 @@ func (b *Bridge) GetBool(key string) bool {
|
||||
return val
|
||||
}
|
||||
|
||||
// GetBoolOrDefault Get config value, or if it doesn't exist a provided default
|
||||
func (b *Bridge) GetBoolOrDefault(key string, thedefault bool) bool {
|
||||
val, ok := b.Config.GetBool(b.Account + "." + key)
|
||||
if !ok {
|
||||
if val, ok = b.Config.GetBool("general." + key); !ok {
|
||||
return thedefault
|
||||
}
|
||||
}
|
||||
return val
|
||||
}
|
||||
|
||||
func (b *Bridge) GetInt(key string) int {
|
||||
val, ok := b.Config.GetInt(b.Account + "." + key)
|
||||
if !ok {
|
||||
|
||||
@@ -149,7 +149,7 @@ func (b *Bwhatsapp) Connect() error {
|
||||
func (b *Bwhatsapp) Login() error {
|
||||
b.Log.Debugln("Logging in..")
|
||||
|
||||
invert := b.GetBoolOrDefault(qrOnWhiteTerminal, false)
|
||||
invert := b.GetBool(qrOnWhiteTerminal) // false is the default
|
||||
qrChan := qrFromTerminal(invert)
|
||||
|
||||
session, err := b.conn.Login(qrChan)
|
||||
|
||||
Reference in New Issue
Block a user