diff --git a/js/mailhops.js b/js/mailhops.js index 63bb086..d7186d6 100644 --- a/js/mailhops.js +++ b/js/mailhops.js @@ -379,11 +379,15 @@ class MailHops { } } if (header_unsubscribe) { - auth.push({ - type: 'Unsubscribe', - color: 'grey', - link: header_unsubscribe.replace('<', '').replace('>', '').trim() - }); + var unsubscribeArr = header_unsubscribe.split(','); + + for (var i = 0; i < unsubscribeArr.length; ++i) { + auth.push({ + type: 'Unsubscribe', + color: 'grey', + link: unsubscribeArr[i].replace(//, '').trim() + }); + } } return auth; } diff --git a/js/mailhops_details.js b/js/mailhops_details.js index 63f9e48..f17944a 100644 --- a/js/mailhops_details.js +++ b/js/mailhops_details.js @@ -147,6 +147,11 @@ function updateContent(msg, noauth) { } else if (msg.message.auth[a].link) { var add = ''; + + // We only check for a comma in case our base code failed to split + // the header links up correctly. + // Usually, it should work fine and add multiple buttons for + // multiple links. if (-1 != msg.message.auth[a].link.indexOf(',')) { add = '' + msg.message.auth[a].type + ''; }