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
fc06d46b
Commit
fc06d46b
authored
May 11, 2013
by
JC Brand
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Give visual indication/tooltips about MUC user roles
parent
283dbd75
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
25 additions
and
5 deletions
+25
-5
converse.css
converse.css
+4
-0
converse.js
converse.js
+21
-5
No files found.
converse.css
View file @
fc06d46b
...
...
@@ -92,7 +92,11 @@ img.spinner {
display
:
block
;
font-size
:
12px
;
padding
:
0.5em
0
0
0.5em
;
cursor
:
default
;
}
ul
.participant-list
li
.moderator
{
color
:
#FE0007
;
}
.chatroom
form
.sendXMPPMessage
{
...
...
converse.js
View file @
fc06d46b
...
...
@@ -1084,8 +1084,8 @@
$presence
=
$
(
presence
),
from
=
$presence
.
attr
(
'
from
'
);
if
(
$presence
.
attr
(
'
type
'
)
!==
'
error
'
)
{
// check for status 110 to see if it's our own presence
if
(
$presence
.
find
(
"
status[code='110']
"
).
length
)
{
// check for status 110 to see if it's our own presence
// check if server changed our nick
if
(
$presence
.
find
(
"
status[code='210']
"
).
length
)
{
this
.
model
.
set
({
'
nick
'
:
Strophe
.
getResourceFromJid
(
from
)});
...
...
@@ -1206,16 +1206,32 @@
return
true
;
},
occupant_template
:
_
.
template
(
'
<li class="{{role}}"
'
+
'
{[ if (role === "moderator") { ]}
'
+
'
title="This user is a moderator"
'
+
'
{[ } ]}
'
+
'
{[ if (role === "participant") { ]}
'
+
'
title="This user can send messages in this room"
'
+
'
{[ } ]}
'
+
'
{[ if (role === "visitor") { ]}
'
+
'
title="This user can NOT send messages in this room"
'
+
'
{[ } ]}
'
+
'
>{{nick}}</li>
'
),
onChatRoomRoster
:
function
(
roster
,
room
)
{
// underscore size is needed because roster is an object
var
controlboxview
=
converse
.
chatboxesview
.
views
.
controlbox
,
roster_size
=
_
.
size
(
roster
),
$participant_list
=
this
.
$el
.
find
(
'
.participant-list
'
),
participants
=
[],
i
;
participants
=
[],
keys
=
_
.
keys
(
roster
),
i
;
this
.
$el
.
find
(
'
.participant-list
'
).
empty
();
for
(
i
=
0
;
i
<
roster_size
;
i
++
)
{
participants
.
push
(
'
<li>
'
+
Strophe
.
unescapeNode
(
_
.
keys
(
roster
)[
i
])
+
'
</li>
'
);
participants
.
push
(
this
.
occupant_template
({
role
:
roster
[
keys
[
i
]].
role
,
nick
:
Strophe
.
unescapeNode
(
keys
[
i
])
}));
}
$participant_list
.
append
(
participants
.
join
(
""
));
return
true
;
...
...
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