Skip to content
This repository has been archived by the owner on Jul 4, 2023. It is now read-only.

Commit

Permalink
Simplify branching when setting mail_port and send_port
Browse files Browse the repository at this point in the history
  • Loading branch information
ralphtheninja committed Aug 28, 2018
1 parent dd059fa commit 9ba30bb
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions index.js
Expand Up @@ -456,10 +456,8 @@ class DeltaChat extends EventEmitter {
this.setConfig('mail_server', opts.mail_server)
}

if (typeof opts.mail_port === 'string') {
this.setConfig('mail_port', opts.mail_port)
} else if (typeof opts.mail_port === 'number') {
this.setConfigInt('mail_port', opts.mail_port)
if (opts.mail_port) {
this.setConfig('mail_port', String(opts.mail_port))
}

if (typeof opts.mail_user === 'string') {
Expand All @@ -472,10 +470,8 @@ class DeltaChat extends EventEmitter {
this.setConfig('send_server', opts.send_server)
}

if (typeof opts.send_port === 'string') {
this.setConfig('send_port', opts.send_port)
} else if (typeof opts.send_port === 'number') {
this.setConfigInt('send_port', opts.send_port)
if (opts.send_port) {
this.setConfig('send_port', String(opts.send_port))
}

if (typeof opts.send_user === 'string') {
Expand Down

0 comments on commit 9ba30bb

Please sign in to comment.