package connector

var exampleConfig = `# KakaoTalk-specific config for mautrix-kakaotalk.
#
# The homeserver, appservice, encryption and database settings are in the
# shared config section (see the default config generated by
# ` + "`--generate-example-config`" + `). This section only has KakaoTalk settings.
user_agent: ""
connect_on_startup: true
connection_timeout: 30
`

type Config struct {
	UserAgent         string `yaml:"user_agent"`
	ConnectOnStartup  bool   `yaml:"connect_on_startup"`
	ConnectionTimeout int    `yaml:"connection_timeout"`
}

func (cfg *Config) GetUserAgent() string {
	if cfg.UserAgent != "" {
		return cfg.UserAgent
	}
	return "KakaoTalk-Windows 4.0"
}

func (cfg *Config) GetConnectionTimeout() int {
	if cfg.ConnectionTimeout > 0 {
		return cfg.ConnectionTimeout
	}
	return 30
}
