Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
converse.js
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
converse.js
Commits
0d6e29f0
Commit
0d6e29f0
authored
Oct 03, 2013
by
JC Brand
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add config option ``allow_contact_requests`` to toggle user adding
parent
6d026f01
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
25 additions
and
10 deletions
+25
-10
CHANGES.rst
CHANGES.rst
+2
-1
converse.js
converse.js
+23
-8
index.html
index.html
+0
-1
No files found.
CHANGES.rst
View file @
0d6e29f0
...
...
@@ -8,7 +8,8 @@ Changelog
* Hungarian translation [w3host]
* Russian translation [bkocherov]
* Update CSS to avoid clash with bootstrap [seocam]
* Add config option ``allow_muc`` to enable/disable multi-user chat (MUC) [jcbrand]
* Add config option ``allow_muc`` to toggle multi-user chat (MUC) [jcbrand]
* Add config option ``allow_contact_requests`` to toggle user adding [jcbrand]
0.6.4 (2013-09-15)
------------------
...
...
converse.js
View file @
0d6e29f0
...
...
@@ -41,8 +41,11 @@
}(
this
,
function
(
$
,
_
,
console
)
{
var
converse
=
{};
converse
.
initialize
=
function
(
settings
,
callback
)
{
// Default values
var
converse
=
this
;
// Default values
this
.
allow_contact_requests
=
true
;
this
.
allow_muc
=
true
;
this
.
allow_otr
=
true
;
this
.
animate
=
true
;
this
.
auto_list_rooms
=
false
;
this
.
auto_subscribe
=
false
;
...
...
@@ -50,17 +53,19 @@
this
.
debug
=
false
;
this
.
hide_muc_server
=
false
;
this
.
i18n
=
locales
.
en
;
this
.
allow_muc
=
true
;
this
.
prebind
=
false
;
this
.
show_controlbox_by_default
=
false
;
this
.
xhr_user_search
=
false
;
this
.
xhr_custom_status
=
false
;
this
.
testing
=
false
;
// Exposes sensitive data for testing. Never set to true in production systems!
this
.
xhr_custom_status
=
false
;
this
.
xhr_user_search
=
false
;
this
.
callback
=
callback
||
function
()
{};
// Allow only the whitelisted settings attributes to be overwritten,
// nothing else.
whitelist
=
[
'
allow_contact_requests
'
,
'
allow_muc
'
,
'
animate
'
,
'
auto_list_rooms
'
,
'
auto_subscribe
'
,
...
...
@@ -687,7 +692,10 @@
'
<option value="offline">
'
+
__
(
'
Offline
'
)
+
'
</option>
'
+
'
</select>
'
+
'
</span>
'
+
'
</form>
'
+
'
</form>
'
),
add_contact_dropdown_template
:
_
.
template
(
'
<dl class="add-converse-contact dropdown">
'
+
'
<dt id="xmpp-contact-search" class="fancy-dropdown">
'
+
'
<a class="toggle-xmpp-contact-form" href="#"
'
+
...
...
@@ -698,7 +706,7 @@
'
</dl>
'
),
add_contact_template
:
_
.
template
(
add_contact_
form_
template
:
_
.
template
(
'
<li>
'
+
'
<form class="add-xmpp-contact">
'
+
'
<input type="text" name="identifier" class="username" placeholder="
'
+
__
(
'
Contact username
'
)
+
'
"/>
'
+
...
...
@@ -723,13 +731,20 @@
render
:
function
()
{
var
markup
;
var
widgets
=
this
.
template
();
this
.
$tabs
.
append
(
this
.
tab_template
());
if
(
converse
.
xhr_user_search
)
{
markup
=
this
.
search_contact_template
();
}
else
{
markup
=
this
.
add_contact_template
();
markup
=
this
.
add_contact_form_template
();
}
if
(
converse
.
allow_contact_requests
)
{
widgets
+=
this
.
add_contact_dropdown_template
();
}
this
.
$el
.
html
(
this
.
template
());
this
.
$el
.
html
(
widgets
);
this
.
$el
.
find
(
'
.search-xmpp ul
'
).
append
(
markup
);
this
.
$el
.
append
(
converse
.
rosterview
.
$el
);
return
this
;
...
...
index.html
View file @
0d6e29f0
...
...
@@ -192,7 +192,6 @@
<script>
require
([
'
converse
'
],
function
(
converse
)
{
converse
.
initialize
({
allow_muc
:
true
,
auto_list_rooms
:
false
,
auto_subscribe
:
false
,
bosh_service_url
:
'
https://bind.opkode.im
'
,
// Please use this connection manager only for testing purposes
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment