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
946e9fed
Commit
946e9fed
authored
Mar 22, 2016
by
JC Brand
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add new MUC option `auto_join_rooms`.
Fixes #156
parent
fc7f5088
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
34 additions
and
5 deletions
+34
-5
docs/CHANGES.md
docs/CHANGES.md
+3
-1
docs/source/configuration.rst
docs/source/configuration.rst
+17
-0
src/converse-muc.js
src/converse-muc.js
+14
-4
No files found.
docs/CHANGES.md
View file @
946e9fed
# Changelog
##
0.11
.0 (Unreleased)
##
1.0
.0 (Unreleased)
-
Add support for messages with type
`headline`
, often used for notifications
from the server. [jcbrand]
...
...
@@ -18,6 +18,8 @@
-
Use
`rel=noopener`
with links that contain
`target=_blank`
to prevent potential
phishing attacks.
[
More info here
](
https://mathiasbynens.github.io/rel-noopener/
)
[jcbrand]
-
#156 Add the option
`auto_join_rooms`
which allows you to automatically
connect to certain rooms once logged in. [jcbrand]
-
#261
`show_controlbox_by_default`
config not working [diditopher]
-
#443 HTML5 notifications of received messages [jcbrand]
-
#534 Updated Russian translation [badfiles]
...
...
docs/source/configuration.rst
View file @
946e9fed
...
...
@@ -256,6 +256,23 @@ auto_join_on_invite
If true, the user will automatically join a chatroom on invite without any confirm.
auto_join_rooms
---------------
* Default: ``[]``
This settings allows you to provide a list of groupchat conversations to be
automatically joined once the user has logged in.
You can either specify a simple list of room JIDs, in which case your nickname
will be taken from your JID, or you can specify a list of maps, where each map
specifies the room's JID and the nickname that should be used.
For example:
`[{'jid': 'room@example.org', 'nick': 'WizardKing69' }]`
.. _`bosh-service-url`:
bosh_service_url
...
...
src/converse-muc.js
View file @
946e9fed
...
...
@@ -150,7 +150,8 @@
this
.
updateSettings
({
allow_muc
:
true
,
auto_join_on_invite
:
false
,
// Auto-join chatroom on invite
auto_join_rooms
:
[],
// List of JIDs of rooms to be joined upon login
auto_join_rooms
:
[],
// List of maps {'jid': 'room@example.org', 'nick': 'WizardKing69' },
// providing room jids and nicks or simply a list JIDs.
auto_list_rooms
:
false
,
hide_muc_server
:
false
,
muc_history_max_stanzas
:
undefined
,
// Takes an integer, limits the amount of messages to fetch from chat room's history
...
...
@@ -1327,15 +1328,24 @@
}
}
};
var
registerInviteHandler
=
function
()
{
var
onConnected
=
function
()
{
converse
.
connection
.
addHandler
(
function
(
message
)
{
converse
.
onDirectMUCInvitation
(
message
);
return
true
;
},
'
jabber:x:conference
'
,
'
message
'
);
_
.
each
(
converse
.
auto_join_rooms
,
function
(
room
)
{
if
(
typeof
room
===
'
string
'
)
{
converse_api
.
rooms
.
open
(
room
);
}
else
if
(
typeof
room
===
'
object
'
)
{
converse_api
.
rooms
.
open
(
room
.
jid
,
room
.
nick
);
}
else
{
converse
.
log
(
'
Invalid room criteria specified for "auto_join_rooms"
'
,
'
error
'
);
}
});
};
converse
.
on
(
'
connected
'
,
registerInviteHandler
);
converse
.
on
(
'
reconnected
'
,
registerInviteHandler
);
converse
.
on
(
'
connected
'
,
onConnected
);
converse
.
on
(
'
reconnected
'
,
onConnected
);
/* ------------------------------------------------------------ */
...
...
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