Commit 479bab2c authored by thierrytiti's avatar thierrytiti

Enhancement #394 Option to allow chatting with pending contacts

parent 785244f1
...@@ -275,6 +275,7 @@ ...@@ -275,6 +275,7 @@
// Default configuration values // Default configuration values
// ---------------------------- // ----------------------------
this.default_settings = { this.default_settings = {
allow_chat_pending_contacts: false,
allow_contact_removal: true, allow_contact_removal: true,
allow_contact_requests: true, allow_contact_requests: true,
allow_dragresize: true, allow_dragresize: true,
...@@ -3855,7 +3856,8 @@ ...@@ -3855,7 +3856,8 @@
this.$el.addClass('pending-xmpp-contact'); this.$el.addClass('pending-xmpp-contact');
this.$el.html(converse.templates.pending_contact( this.$el.html(converse.templates.pending_contact(
_.extend(item.toJSON(), { _.extend(item.toJSON(), {
'desc_remove': __('Click to remove this contact') 'desc_remove': __('Click to remove this contact'),
'allow_chat_pending_contacts': converse.allow_chat_pending_contacts
}) })
)); ));
} else if (requesting === true) { } else if (requesting === true) {
...@@ -3863,7 +3865,8 @@ ...@@ -3863,7 +3865,8 @@
this.$el.html(converse.templates.requesting_contact( this.$el.html(converse.templates.requesting_contact(
_.extend(item.toJSON(), { _.extend(item.toJSON(), {
'desc_accept': __("Click to accept this contact request"), 'desc_accept': __("Click to accept this contact request"),
'desc_decline': __("Click to decline this contact request") 'desc_decline': __("Click to decline this contact request"),
'allow_chat_pending_contacts': converse.allow_chat_pending_contacts
}) })
)); ));
converse.controlboxtoggle.showControlBox(); converse.controlboxtoggle.showControlBox();
......
...@@ -6,6 +6,7 @@ Changelog ...@@ -6,6 +6,7 @@ Changelog
* #144 Add Ping funcionnality and Pong Handler [thierrytiti] * #144 Add Ping funcionnality and Pong Handler [thierrytiti]
* #389 Allow login panel placeholders and roster item 'Name' translations. [gbonvehi] * #389 Allow login panel placeholders and roster item 'Name' translations. [gbonvehi]
* #394 Option to allow chatting with pending contacts [thierrytiti]
* #396 Add automatic Away mode and XEP-0352 support [thierrytiti] * #396 Add automatic Away mode and XEP-0352 support [thierrytiti]
* #400, #410 Allow offline pretty status and placeholder for "Insert a smiley" to be translated [thierrytiti] * #400, #410 Allow offline pretty status and placeholder for "Insert a smiley" to be translated [thierrytiti]
* #401 Updated French translation [thierrytiti] * #401 Updated French translation [thierrytiti]
......
...@@ -98,6 +98,13 @@ Here's an example of converse.js being initialized with these three options: ...@@ -98,6 +98,13 @@ Here's an example of converse.js being initialized with these three options:
}); });
allow_chat_pending_contacts
---------------------------
* Default: ``false``
Allow the user to chat with pending contacts.
allow_contact_removal allow_contact_removal
--------------------- ---------------------
......
{[ if (allow_chat_pending_contacts) { ]}
<a class="open-chat"href="#">
{[ } ]}
<span class="pending-contact-name" title="Name: {{fullname}} <span class="pending-contact-name" title="Name: {{fullname}}
JID: {{jid}}">{{fullname}}</span> <a class="remove-xmpp-contact icon-remove" title="{{desc_remove}}" href="#"></a> JID: {{jid}}">{{fullname}}</span>
{[ if (allow_chat_pending_contacts) { ]}
</a>
{[ } ]}
<a class="remove-xmpp-contact icon-remove" title="{{desc_remove}}" href="#"></a>
{[ if (allow_chat_pending_contacts) { ]}
<a class="open-chat"href="#">
{[ } ]}
<span class="req-contact-name" title="Name: {{fullname}} <span class="req-contact-name" title="Name: {{fullname}}
JID: {{jid}}">{{fullname}}</span> JID: {{jid}}">{{fullname}}</span>
{[ if (allow_chat_pending_contacts) { ]}
</a>
{[ } ]}
<span class="request-actions"> <span class="request-actions">
<a class="accept-xmpp-request icon-checkmark" title="{{desc_accept}}" href="#"></a> <a class="accept-xmpp-request icon-checkmark" title="{{desc_accept}}" href="#"></a>
<a class="decline-xmpp-request icon-close" title="{{desc_decline}}" href="#"></a> <a class="decline-xmpp-request icon-close" title="{{desc_decline}}" 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