Commit 90e4d6cb authored by JC Brand's avatar JC Brand

Add new configuration setting "allow_contact_removal".

parent 2888bc59
......@@ -244,6 +244,7 @@
// Default configuration values
// ----------------------------
this.default_settings = {
allow_contact_removal: true,
allow_contact_requests: true,
allow_dragresize: true,
allow_logout: true,
......@@ -3572,7 +3573,8 @@
_.extend(item.toJSON(), {
'desc_status': STATUSES[chat_status||'offline'],
'desc_chat': __('Click to chat with this contact'),
'desc_remove': __('Click to remove this contact')
'desc_remove': __('Click to remove this contact'),
'allow_contact_removal': converse.allow_contact_removal
})
));
}
......@@ -3586,6 +3588,7 @@
removeContact: function (ev) {
if (ev && ev.preventDefault) { ev.preventDefault(); }
if (!converse.allow_contact_removal) { return; }
var result = confirm(__("Are you sure you want to remove this contact?"));
if (result === true) {
var bare_jid = this.model.get('jid');
......
Changelog
=========
0.9.1 (Unreleased)
------------------
* Set the JID input field in the login form to ``type=email``. [chatme]
* New configuration setting ``allow_contact_removal``. [jcbrand]
0.9.0 (2015-03-06)
------------------
......
......@@ -28,6 +28,14 @@ JS file so that it will include the new settings. Please refer to the
Configuration variables
=======================
allow_contact_removal
---------------------
Default: ``true``
Allow the user to remove roster contacts by clicking on the delete icon
(i.e. traschcan) next to a contact's name in the roster.
allow_contact_requests
----------------------
......
<a class="open-chat" title="Name: {{fullname}}
JID: {{jid}}
{{desc_chat}}" href="#"><span class="icon-{{chat_status}}" title="{{desc_status}}"></span>{{fullname}}</a>
{[ if (allow_contact_removal) { ]}
<a class="remove-xmpp-contact icon-remove" title="{{desc_remove}}" href="#"></a>
{[ } ]}
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment