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
d895c7fc
Commit
d895c7fc
authored
Nov 14, 2019
by
JC Brand
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Bugfix. Leave space between classes
parent
149fcf5d
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
8 additions
and
7 deletions
+8
-7
spec/muc_messages.js
spec/muc_messages.js
+1
-1
src/converse-message-view.js
src/converse-message-view.js
+6
-5
src/templates/message.html
src/templates/message.html
+1
-1
No files found.
spec/muc_messages.js
View file @
d895c7fc
...
@@ -218,11 +218,11 @@
...
@@ -218,11 +218,11 @@
type
:
'
groupchat
'
type
:
'
groupchat
'
}).
c
(
'
body
'
).
t
(
'
I wrote this message!
'
).
tree
();
}).
c
(
'
body
'
).
t
(
'
I wrote this message!
'
).
tree
();
await
view
.
model
.
onMessage
(
msg
);
await
view
.
model
.
onMessage
(
msg
);
await
u
.
waitUntil
(()
=>
view
.
el
.
querySelectorAll
(
'
.chat-msg
'
).
length
);
expect
(
view
.
model
.
messages
.
last
().
occupant
.
get
(
'
affiliation
'
)).
toBe
(
'
owner
'
);
expect
(
view
.
model
.
messages
.
last
().
occupant
.
get
(
'
affiliation
'
)).
toBe
(
'
owner
'
);
expect
(
view
.
model
.
messages
.
last
().
occupant
.
get
(
'
role
'
)).
toBe
(
'
moderator
'
);
expect
(
view
.
model
.
messages
.
last
().
occupant
.
get
(
'
role
'
)).
toBe
(
'
moderator
'
);
expect
(
view
.
el
.
querySelectorAll
(
'
.chat-msg
'
).
length
).
toBe
(
1
);
expect
(
view
.
el
.
querySelectorAll
(
'
.chat-msg
'
).
length
).
toBe
(
1
);
expect
(
sizzle
(
'
.chat-msg
'
,
view
.
el
).
pop
().
classList
.
value
.
trim
()).
toBe
(
'
message chat-msg groupchat moderator owner
'
);
expect
(
sizzle
(
'
.chat-msg
'
,
view
.
el
).
pop
().
classList
.
value
.
trim
()).
toBe
(
'
message chat-msg groupchat moderator owner
'
);
let
presence
=
$pres
({
let
presence
=
$pres
({
to
:
'
romeo@montague.lit/orchard
'
,
to
:
'
romeo@montague.lit/orchard
'
,
from
:
'
lounge@montague.lit/romeo
'
,
from
:
'
lounge@montague.lit/romeo
'
,
...
...
src/converse-message-view.js
View file @
d895c7fc
...
@@ -297,7 +297,7 @@ converse.plugins.add('converse-message-view', {
...
@@ -297,7 +297,7 @@ converse.plugins.add('converse-message-view', {
getRetractionText
()
{
getRetractionText
()
{
const
username
=
this
.
model
.
getDisplayName
();
const
username
=
this
.
model
.
getDisplayName
();
let
retraction_text
=
__
(
'
A message by %1$s has been retracted
'
,
username
);
let
retraction_text
=
__
(
'
%1$s has retracted this message
'
,
username
);
if
(
this
.
model
.
get
(
'
type
'
)
===
'
groupchat
'
)
{
if
(
this
.
model
.
get
(
'
type
'
)
===
'
groupchat
'
)
{
const
retracted_by_mod
=
this
.
model
.
get
(
'
moderated_by
'
);
const
retracted_by_mod
=
this
.
model
.
get
(
'
moderated_by
'
);
if
(
retracted_by_mod
)
{
if
(
retracted_by_mod
)
{
...
@@ -382,18 +382,19 @@ converse.plugins.add('converse-message-view', {
...
@@ -382,18 +382,19 @@ converse.plugins.add('converse-message-view', {
];
];
if
(
this
.
model
.
get
(
'
type
'
)
===
'
groupchat
'
)
{
if
(
this
.
model
.
get
(
'
type
'
)
===
'
groupchat
'
)
{
if
(
this
.
model
.
occupant
)
{
if
(
this
.
model
.
occupant
)
{
extra_classes
+=
`
${
this
.
model
.
occupant
.
get
(
'
role
'
)
||
''
}
${
this
.
model
.
occupant
.
get
(
'
affiliation
'
)
||
''
}
`
;
extra_classes
.
push
(
this
.
model
.
occupant
.
get
(
'
role
'
));
extra_classes
.
push
(
this
.
model
.
occupant
.
get
(
'
affiliation
'
));
}
}
if
(
this
.
model
.
get
(
'
sender
'
)
===
'
them
'
&&
this
.
model
.
collection
.
chatbox
.
isUserMentioned
(
this
.
model
))
{
if
(
this
.
model
.
get
(
'
sender
'
)
===
'
them
'
&&
this
.
model
.
collection
.
chatbox
.
isUserMentioned
(
this
.
model
))
{
// Add special class to mark groupchat messages
// Add special class to mark groupchat messages
// in which we are mentioned.
// in which we are mentioned.
extra_classes
+=
'
mentioned
'
;
extra_classes
.
push
(
'
mentioned
'
)
;
}
}
}
}
if
(
this
.
model
.
get
(
'
correcting
'
))
{
if
(
this
.
model
.
get
(
'
correcting
'
))
{
extra_classes
+=
'
correcting
'
;
extra_classes
.
push
(
'
correcting
'
)
;
}
}
return
extra_classes
;
return
extra_classes
.
filter
(
c
=>
c
).
join
(
"
"
)
;
}
}
});
});
}
}
...
...
src/templates/message.html
View file @
d895c7fc
<div
class=
"message chat-msg {{{o.type}}}
{[ if (o.is_me_message) { ]} chat-msg--action {[ } ]}{{{o.extra_classes}}
}"
<div
class=
"message chat-msg {{{o.type}}}
{{{o.extra_classes}}} {[ if (o.is_me_message) { ]} chat-msg--action {[ } ]
}"
data-isodate=
"{{{o.time}}}"
data-msgid=
"{{{o.msgid}}}"
data-from=
"{{{o.from}}}"
data-encrypted=
"{{{o.is_encrypted}}}"
>
data-isodate=
"{{{o.time}}}"
data-msgid=
"{{{o.msgid}}}"
data-from=
"{{{o.from}}}"
data-encrypted=
"{{{o.is_encrypted}}}"
>
{[ if (o.type !== 'headline'
&&
!o.is_me_message) { ]}
{[ if (o.type !== 'headline'
&&
!o.is_me_message) { ]}
<canvas
class=
"avatar chat-msg__avatar"
height=
"36"
width=
"36"
></canvas>
<canvas
class=
"avatar chat-msg__avatar"
height=
"36"
width=
"36"
></canvas>
...
...
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