diff roster.js @ 46:af2874ff7234

mathieui: Ask the user for confirmation before deleting PEP nodes or contacts.
author Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
date Sat, 23 May 2020 19:01:23 +0200
parents c2e2b107c7c1
children 010b905a74d4
line wrap: on
line diff
--- a/roster.js
+++ b/roster.js
@@ -55,6 +55,9 @@ function initRoster(connection) {
             button.classList.add('btn-danger');
             button.textContent = '✕';
             button.onclick = function (evt) {
+                const really = confirm('Do you really want to remove ' + jid + '?');
+                if (!really)
+                    return;
                 const iq = $iq({type: 'set'})
                     .c('query', {xmlns: NS.roster})
                         .c('item', {jid: jid, subscription: 'unsubscribe'});