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
27bc33ba
Commit
27bc33ba
authored
Aug 07, 2018
by
JC Brand
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use nickname from global settings when entering a room
parent
bfb7ea4f
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
24 additions
and
7 deletions
+24
-7
spec/chatroom.js
spec/chatroom.js
+13
-0
src/converse-core.js
src/converse-core.js
+1
-1
src/converse-muc-views.js
src/converse-muc-views.js
+4
-0
src/converse-muc.js
src/converse-muc.js
+1
-1
tests/utils.js
tests/utils.js
+5
-5
No files found.
spec/chatroom.js
View file @
27bc33ba
...
...
@@ -2659,6 +2659,19 @@
describe
(
"
When attempting to enter a groupchat
"
,
function
()
{
it
(
"
will use the nickname set in the global settings if the user doesn't have a VCard nickname
"
,
mock
.
initConverseWithPromises
(
null
,
[
'
rosterGroupsFetched
'
,
'
chatBoxesFetched
'
],
{
'
nickname
'
:
'
Benedict-Cucumberpatch
'
},
function
(
done
,
_converse
)
{
test_utils
.
openChatRoomViaModal
(
_converse
,
'
problematic@muc.localhost
'
)
.
then
(
function
()
{
const
view
=
_converse
.
chatboxviews
.
get
(
'
problematic@muc.localhost
'
);
expect
(
view
.
model
.
get
(
'
nick
'
)).
toBe
(
'
Benedict-Cucumberpatch
'
);
done
();
}).
catch
(
_
.
partial
(
console
.
error
,
_
));
}));
it
(
"
will show an error message if the groupchat requires a password
"
,
mock
.
initConverseWithPromises
(
null
,
[
'
rosterGroupsFetched
'
,
'
chatBoxesFetched
'
],
{},
...
...
src/converse-core.js
View file @
27bc33ba
...
...
@@ -812,7 +812,7 @@
defaults
()
{
return
{
"
jid
"
:
_converse
.
bare_jid
,
"
status
"
:
_converse
.
default_state
,
"
status
"
:
_converse
.
default_state
}
},
...
...
src/converse-muc-views.js
View file @
27bc33ba
...
...
@@ -477,6 +477,10 @@
openChatRoom
(
ev
)
{
ev
.
preventDefault
();
const
data
=
this
.
parseRoomDataFromEvent
(
ev
.
target
);
if
(
data
.
nick
===
""
)
{
// Make sure defaults apply if no nick is provided.
data
.
nick
=
undefined
;
}
_converse
.
api
.
rooms
.
open
(
data
.
jid
,
data
);
this
.
modal
.
hide
();
ev
.
target
.
reset
();
...
...
src/converse-muc.js
View file @
27bc33ba
...
...
@@ -171,7 +171,7 @@
'
affiliation
'
:
null
,
'
connection_status
'
:
converse
.
ROOMSTATUS
.
DISCONNECTED
,
'
name
'
:
''
,
'
nick
'
:
_converse
.
xmppstatus
.
get
(
'
nickname
'
),
'
nick
'
:
_converse
.
xmppstatus
.
get
(
'
nickname
'
)
||
_converse
.
nickname
,
'
description
'
:
''
,
'
features_fetched
'
:
false
,
'
roomconfig
'
:
{},
...
...
tests/utils.js
View file @
27bc33ba
...
...
@@ -103,18 +103,18 @@
return
utils
.
waitUntil
(()
=>
_converse
.
chatboxviews
.
get
(
jid
));
};
utils
.
openChatRoomViaModal
=
function
(
_converse
,
jid
,
nick
)
{
utils
.
openChatRoomViaModal
=
function
(
_converse
,
jid
,
nick
=
''
)
{
// Opens a new chatroom
return
new
Promise
(
function
(
resolve
,
reject
)
{
utils
.
openControlBox
(
_converse
);
var
roomspanel
=
_converse
.
chatboxviews
.
get
(
'
controlbox
'
).
roomspanel
;
const
roomspanel
=
_converse
.
chatboxviews
.
get
(
'
controlbox
'
).
roomspanel
;
roomspanel
.
el
.
querySelector
(
'
.show-add-muc-modal
'
).
click
();
utils
.
closeControlBox
(
_converse
);
const
modal
=
roomspanel
.
add_room_modal
;
utils
.
waitUntil
(
function
()
{
return
u
.
isVisible
(
modal
.
el
);
},
1000
).
then
(
function
()
{
utils
.
waitUntil
(()
=>
u
.
isVisible
(
modal
.
el
),
1000
)
.
then
(()
=>
{
modal
.
el
.
querySelector
(
'
input[name="chatroom"]
'
).
value
=
jid
;
modal
.
el
.
querySelector
(
'
input[name="nickname"]
'
).
value
=
nick
;
modal
.
el
.
querySelector
(
'
form input[type="submit"]
'
).
click
();
resolve
();
}).
catch
(
_
.
partial
(
console
.
error
,
_
));
...
...
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