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
5a72466c
Commit
5a72466c
authored
Nov 22, 2016
by
JC Brand
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Rename variables to adhere to coding style.
parent
5e9e6852
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
15 deletions
+15
-15
spec/chatroom.js
spec/chatroom.js
+3
-3
src/converse-muc.js
src/converse-muc.js
+12
-12
No files found.
spec/chatroom.js
View file @
5a72466c
...
...
@@ -529,7 +529,7 @@
expect
(
$occupants
.
children
().
first
(
0
).
text
()).
toBe
(
"
oldnick
"
);
expect
(
$chat_content
.
find
(
'
div.chat-info
'
).
length
).
toBe
(
1
);
expect
(
$chat_content
.
find
(
'
div.chat-info
'
).
html
()).
toBe
(
__
(
converse
.
muc
.
new
NicknameM
essages
[
"
210
"
],
"
oldnick
"
));
expect
(
$chat_content
.
find
(
'
div.chat-info
'
).
html
()).
toBe
(
__
(
converse
.
muc
.
new
_nickname_m
essages
[
"
210
"
],
"
oldnick
"
));
presence
=
$pres
().
attrs
({
from
:
'
lounge@localhost/oldnick
'
,
...
...
@@ -549,7 +549,7 @@
converse
.
connection
.
_dataRecv
(
test_utils
.
createRequest
(
presence
));
expect
(
$chat_content
.
find
(
'
div.chat-info
'
).
length
).
toBe
(
2
);
expect
(
$chat_content
.
find
(
'
div.chat-info
'
).
last
().
html
()).
toBe
(
__
(
converse
.
muc
.
new
NicknameM
essages
[
"
303
"
],
"
newnick
"
));
expect
(
$chat_content
.
find
(
'
div.chat-info
'
).
last
().
html
()).
toBe
(
__
(
converse
.
muc
.
new
_nickname_m
essages
[
"
303
"
],
"
newnick
"
));
$occupants
=
view
.
$
(
'
.occupant-list
'
);
expect
(
$occupants
.
children
().
length
).
toBe
(
0
);
...
...
@@ -569,7 +569,7 @@
converse
.
connection
.
_dataRecv
(
test_utils
.
createRequest
(
presence
));
expect
(
$chat_content
.
find
(
'
div.chat-info
'
).
length
).
toBe
(
2
);
expect
(
$chat_content
.
find
(
'
div.chat-info
'
).
last
().
html
()).
toBe
(
__
(
converse
.
muc
.
new
NicknameM
essages
[
"
303
"
],
"
newnick
"
));
expect
(
$chat_content
.
find
(
'
div.chat-info
'
).
last
().
html
()).
toBe
(
__
(
converse
.
muc
.
new
_nickname_m
essages
[
"
303
"
],
"
newnick
"
));
$occupants
=
view
.
$
(
'
.occupant-list
'
);
expect
(
$occupants
.
children
().
length
).
toBe
(
1
);
expect
(
$occupants
.
children
().
first
(
0
).
text
()).
toBe
(
"
newnick
"
);
...
...
src/converse-muc.js
View file @
5a72466c
...
...
@@ -102,7 +102,7 @@
* 332 presence Removal from room Inform user that he or she is being removed from the room because of a system shutdown
*/
converse
.
muc
=
{
info
M
essages
:
{
info
_m
essages
:
{
100
:
__
(
'
This room is not anonymous
'
),
102
:
__
(
'
This room now shows unavailable members
'
),
103
:
__
(
'
This room does not show unavailable members
'
),
...
...
@@ -115,7 +115,7 @@
201
:
__
(
'
A new room has been created
'
)
},
disconnect
M
essages
:
{
disconnect
_m
essages
:
{
301
:
__
(
'
You have been banned from this room
'
),
307
:
__
(
'
You have been kicked from this room
'
),
321
:
__
(
"
You have been removed from this room because of an affiliation change
"
),
...
...
@@ -123,7 +123,7 @@
332
:
__
(
"
You have been removed from this room because the MUC (Multi-user chat) service is being shut down.
"
)
},
action
InfoM
essages
:
{
action
_info_m
essages
:
{
/* XXX: Note the triple underscore function and not double
* underscore.
*
...
...
@@ -141,7 +141,7 @@
322
:
___
(
"
<strong>%1$s</strong> has been removed for not being a member
"
)
},
new
NicknameM
essages
:
{
new
_nickname_m
essages
:
{
210
:
___
(
'
Your nickname has been automatically set to: <strong>%1$s</strong>
'
),
303
:
___
(
'
Your nickname has been changed to: <strong>%1$s</strong>
'
)
}
...
...
@@ -1048,13 +1048,13 @@
getMessageFromStatus
:
function
(
stat
,
is_self
,
from_nick
,
item
)
{
var
code
=
stat
.
getAttribute
(
'
code
'
);
if
(
is_self
&&
code
===
"
210
"
)
{
return
__
(
converse
.
muc
.
new
NicknameM
essages
[
code
],
from_nick
);
return
__
(
converse
.
muc
.
new
_nickname_m
essages
[
code
],
from_nick
);
}
else
if
(
is_self
&&
code
===
"
303
"
)
{
return
__
(
converse
.
muc
.
new
NicknameM
essages
[
code
],
item
.
getAttribute
(
'
nick
'
));
}
else
if
(
!
is_self
&&
(
code
in
converse
.
muc
.
action
InfoM
essages
))
{
return
__
(
converse
.
muc
.
action
InfoM
essages
[
code
],
from_nick
);
}
else
if
(
code
in
converse
.
muc
.
info
M
essages
)
{
return
converse
.
muc
.
info
M
essages
[
code
];
return
__
(
converse
.
muc
.
new
_nickname_m
essages
[
code
],
item
.
getAttribute
(
'
nick
'
));
}
else
if
(
!
is_self
&&
(
code
in
converse
.
muc
.
action
_info_m
essages
))
{
return
__
(
converse
.
muc
.
action
_info_m
essages
[
code
],
from_nick
);
}
else
if
(
code
in
converse
.
muc
.
info
_m
essages
)
{
return
converse
.
muc
.
info
_m
essages
[
code
];
}
else
if
(
code
!==
'
110
'
)
{
if
(
stat
.
textContent
)
{
// Sometimes the status contains human readable text and not a code.
...
...
@@ -1096,11 +1096,11 @@
notification
.
actor
=
actor
?
actor
.
getAttribute
(
'
nick
'
)
:
undefined
;
}
var
codes
=
_
.
map
(
statuses
,
function
(
stat
)
{
return
stat
.
getAttribute
(
'
code
'
);
});
var
disconnection_codes
=
_
.
intersection
(
codes
,
_
.
keys
(
converse
.
muc
.
disconnect
M
essages
));
var
disconnection_codes
=
_
.
intersection
(
codes
,
_
.
keys
(
converse
.
muc
.
disconnect
_m
essages
));
var
disconnected
=
is_self
&&
disconnection_codes
.
length
>
0
;
if
(
disconnected
)
{
notification
.
disconnected
=
true
;
notification
.
disconnection_message
=
converse
.
muc
.
disconnect
M
essages
[
disconnection_codes
[
0
]];
notification
.
disconnection_message
=
converse
.
muc
.
disconnect
_m
essages
[
disconnection_codes
[
0
]];
}
return
notification
;
},
...
...
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