#475 delete .gitignore and getBoolOrDefault function

This commit is contained in:
Krzysztof Madejski
2019-02-19 12:10:42 +01:00
parent a2baf3ff70
commit 24f1fcebb9
3 changed files with 1 additions and 14 deletions

2
.gitignore vendored
View File

@@ -1,2 +0,0 @@
matterbridge.toml

View File

@@ -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 {

View File

@@ -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)