Comparing version 0.6.16 to 0.6.17
@@ -295,10 +295,18 @@ const debug = require('debug') ('sipware:headers') | ||
tag = tag || addr.tag; | ||
if(!addr || !addr.address) return ''; | ||
if(tag && tag.length) { | ||
var address = addr.name + '+' + tag + '@' + this.normalizeDomain(addr.domain); | ||
var address = `${addr.name}+${tag}@${this.normalizeDomain(addr.domain)}`; | ||
} else { | ||
var address = addr.name + '@' + this.normalizeDomain(addr.domain); | ||
var address = `${addr.name}@${this.normalizeDomain(addr.domain)}`; | ||
} | ||
return addr.display_name ? (this.encodeDisplayName(addr.display_name) + ' <' + address + '>') : address; | ||
if(addr.display_name) { | ||
var str = `${this.encodeDisplayName(addr.display_name)} <${address}>` | ||
return addr.group ? `${this.encodeDisplayName(addr.group)}: ${str};` : str; | ||
} else { | ||
return addr.group ? `${this.encodeDisplayName(addr.group)}: ${address};` : address; | ||
} | ||
}, | ||
@@ -305,0 +313,0 @@ printSingleAddrs(addrs = []) { |
@@ -67,3 +67,3 @@ { | ||
"optionalDependencies": {}, | ||
"version": "0.6.16", | ||
"version": "0.6.17", | ||
"directories": { | ||
@@ -70,0 +70,0 @@ "lib": "lib" |
126511
3084