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
be47ceaa
Commit
be47ceaa
authored
Jul 20, 2016
by
JC Brand
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
In case of a nickname conflict, enable the user to choose a new one
parent
dcd1a847
Changes
7
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
27 additions
and
9 deletions
+27
-9
css/converse.css
css/converse.css
+3
-0
docs/CHANGES.md
docs/CHANGES.md
+7
-4
sass/_chatrooms.scss
sass/_chatrooms.scss
+5
-0
sass/_variables.scss
sass/_variables.scss
+2
-0
spec/chatroom.js
spec/chatroom.js
+2
-1
src/converse-muc.js
src/converse-muc.js
+7
-4
src/templates/chatroom_nickname_form.html
src/templates/chatroom_nickname_form.html
+1
-0
No files found.
css/converse.css
View file @
be47ceaa
...
...
@@ -2061,6 +2061,9 @@
height
:
calc
(
100%
-
55px
);
overflow-y
:
auto
;
position
:
absolute
;
}
#conversejs
.chatroom
.box-flyout
.chatroom-body
.chatroom-form-container
.validation-message
{
font-size
:
90%
;
color
:
#D24E2B
;
}
#conversejs
.chatroom
.chat-textarea
{
border-bottom-right-radius
:
0
;
}
#conversejs
.chatroom
.room-invite
{
...
...
docs/CHANGES.md
View file @
be47ceaa
# Changelog
## 1.0.5 (Unreleased)
-
In case of a nickname conflict when joining a room, allow the user to choose a new nickname. [jcbrand]
-
Check whether the user has a reserved nickname before entering a room, and if so, use it. [jcbrand]
## 1.0.4 (2016-07-26)
-
Restrict occupants sidebar to 30% chatroom width. [jcbrand]
-
Made requesting contacts more visible, by placing them at the top of the roster. [jcbrand]
-
`insertIntoPage`
method of
`ChatBoxView`
has been renamed to
`insertIntoDOM`
,
to make it the same as the method of
`ChatRoomView`
. [jcbrand]
-
Render error messages received from the server (for undelivered chat
messages). [jcbrand]
-
Render error messages received from the server (for undelivered chat messages). [jcbrand]
-
Don't hide requesting contacts when filtering by chat state. [jcbrand]
-
When logging in anonymously, the server JID can now be passed in via
`converse.initialize`
or via
`converse.user.login`
. [jcbrand]
-
When logging in anonymously, the server JID can now be passed in via
`converse.initialize`
or via
`converse.user.login`
. [jcbrand]
## 1.0.3 (2016-06-20)
...
...
sass/_chatrooms.scss
View file @
be47ceaa
...
...
@@ -130,6 +130,11 @@
@include
calc
(
height
,
'100% -
#{
$chat-head-height
}
'
);
overflow-y
:
auto
;
position
:
absolute
;
.validation-message
{
font-size
:
90%
;
color
:
$error-color
;
}
}
}
}
...
...
sass/_variables.scss
View file @
be47ceaa
...
...
@@ -40,6 +40,8 @@ $toolbar-color: #FFF5EE !default;
$moderator-color
:
#D24E2B
!
default
;
$online-color
:
#1A9707
!
default
;
$error-color
:
#D24E2B
!
default
;
$chatbox-border-radius
:
4px
!
default
;
$bottom-gutter-height
:
35px
!
default
;
$chatbox-hover-height
:
6px
!
default
;
...
...
spec/chatroom.js
View file @
be47ceaa
...
...
@@ -899,7 +899,8 @@
var
view
=
this
.
chatboxviews
.
get
(
'
problematic@muc.localhost
'
);
spyOn
(
view
,
'
showErrorMessage
'
).
andCallThrough
();
view
.
onChatRoomPresence
(
presence
,
{
'
nick
'
:
'
dummy
'
});
expect
(
view
.
$el
.
find
(
'
.chatroom-body p:last
'
).
text
()).
toBe
(
"
Your nickname is already taken
"
);
expect
(
view
.
$el
.
find
(
'
.chatroom-body p:last
'
).
text
()).
toBe
(
"
The nickname you chose is reserved or currently in use, please choose a different one.
"
);
}.
bind
(
converse
));
it
(
"
will show an error message if the room doesn't yet exist
"
,
function
()
{
...
...
src/converse-muc.js
View file @
be47ceaa
...
...
@@ -780,14 +780,18 @@
}
},
renderNicknameForm
:
function
()
{
renderNicknameForm
:
function
(
message
)
{
this
.
$
(
'
.chatroom-body
'
).
children
().
addClass
(
'
hidden
'
);
this
.
$
(
'
span.centered.spinner
'
).
remove
();
if
(
typeof
message
!==
"
string
"
)
{
message
=
''
;
}
this
.
$
(
'
.chatroom-body
'
).
append
(
converse
.
templates
.
chatroom_nickname_form
({
heading
:
__
(
'
Please choose your nickname
'
),
label_nickname
:
__
(
'
Nickname
'
),
label_join
:
__
(
'
Enter room
'
)
label_join
:
__
(
'
Enter room
'
),
validation_message
:
message
}));
this
.
$
(
'
.chatroom-form
'
).
on
(
'
submit
'
,
this
.
submitNickname
.
bind
(
this
));
},
...
...
@@ -966,8 +970,7 @@
}
else
if
(
$error
.
find
(
'
not-acceptable
'
).
length
)
{
this
.
showDisconnectMessage
(
__
(
"
Your nickname doesn't conform to this room's policies
"
));
}
else
if
(
$error
.
find
(
'
conflict
'
).
length
)
{
this
.
showDisconnectMessage
(
__
(
"
Your nickname is already taken
"
));
// TODO: give user the option of choosing a different nickname
this
.
renderNicknameForm
(
__
(
"
The nickname you chose is reserved or currently in use, please choose a different one.
"
));
}
else
if
(
$error
.
find
(
'
item-not-found
'
).
length
)
{
this
.
showDisconnectMessage
(
__
(
"
This room does not (yet) exist
"
));
}
else
if
(
$error
.
find
(
'
service-unavailable
'
).
length
)
{
...
...
src/templates/chatroom_nickname_form.html
View file @
be47ceaa
...
...
@@ -2,6 +2,7 @@
<form
class=
"pure-form converse-form chatroom-form"
>
<fieldset>
<label>
{{heading}}
</label>
<p
class=
"validation-message"
>
{{validation_message}}
</p>
<input
type=
"text"
required=
"required"
name=
"nick"
class=
"new-chatroom-nick"
placeholder=
"{{label_nickname}}"
/>
</fieldset>
<fieldset>
...
...
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