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
f3f58a8d
Commit
f3f58a8d
authored
Jul 06, 2018
by
JC Brand
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Test multiple corrections of the same message
parent
9e965fa2
Changes
6
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
39 additions
and
14 deletions
+39
-14
CHANGES.md
CHANGES.md
+1
-0
dist/converse.js
dist/converse.js
+5
-4
spec/chatroom.js
spec/chatroom.js
+2
-3
spec/messages.js
spec/messages.js
+26
-3
src/converse-message-view.js
src/converse-message-view.js
+4
-3
src/templates/message_versions_modal.html
src/templates/message_versions_modal.html
+1
-1
No files found.
CHANGES.md
View file @
f3f58a8d
...
...
@@ -22,6 +22,7 @@
If the device is trusted, localStorage is used and user data is cached indefinitely.
-
Initial support for XEP-0357 Push Notifications, specifically registering an "App Server".
-
Add support for logging in via OAuth (see the
[
oauth_providers
](
https://conversejs.org/docs/html/configurations.html#oauth-providers
)
setting)
-
XEP-0308: Render message corrections
### Bugfixes
...
...
dist/converse.js
View file @
f3f58a8d
...
...
@@ -74531,6 +74531,7 @@ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_
this.model.on('change:progress', this.renderFileUploadProgresBar, this);
this.model.on('change:type', this.render, this);
this.model.on('change:upload', this.render, this);
this.model.on('change:message', this.render, this);
this.model.on('destroy', this.remove, this);
this.render();
},
...
...
@@ -74665,13 +74666,13 @@ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_
showMessageVersionsModal(ev) {
ev.preventDefault();
if (_.isUndefined(this.message_versions_modal)) {
this.message_versions_modal = new _converse.MessageVersionsModal({
if (_.isUndefined(this.m
odel.m
essage_versions_modal)) {
this.m
odel.m
essage_versions_modal = new _converse.MessageVersionsModal({
'model': this.model
});
}
this.message_versions_modal.show(ev);
this.m
odel.m
essage_versions_modal.show(ev);
},
isMeCommand() {
...
...
@@ -85616,7 +85617,7 @@ __e(o.__('Message versions')) +
__e(o.label_close) +
'"><span aria-hidden="true">×</span></button>\n </div>\n <div class="modal-body">\n <h4>Older versions</h4>\n ';
o.older_versions.forEach(function (text) { ;
__p += ' <p>' +
__p += ' <p
class="older-msg"
>' +
__e(text) +
'</p> ';
}); ;
spec/chatroom.js
View file @
f3f58a8d
...
...
@@ -3182,9 +3182,8 @@
roomspanel
.
el
.
querySelector
(
'
.show-add-muc-modal
'
).
click
();
test_utils
.
closeControlBox
(
_converse
);
const
modal
=
roomspanel
.
add_room_modal
;
test_utils
.
waitUntil
(
function
()
{
return
u
.
isVisible
(
modal
.
el
);
},
1000
).
then
(
function
()
{
test_utils
.
waitUntil
(()
=>
u
.
isVisible
(
modal
.
el
),
1000
)
.
then
(
function
()
{
spyOn
(
_converse
.
ChatRoom
.
prototype
,
'
getRoomFeatures
'
).
and
.
callFake
(
function
()
{
var
deferred
=
new
$
.
Deferred
();
deferred
.
resolve
();
...
...
spec/messages.js
View file @
f3f58a8d
...
...
@@ -100,14 +100,37 @@
'
to
'
:
_converse
.
connection
.
jid
,
'
type
'
:
'
chat
'
,
'
id
'
:
u
.
getUniqueId
(),
}).
c
(
'
body
'
).
t
(
'
But soft, what light through yonder
window
breaks?
'
).
up
()
}).
c
(
'
body
'
).
t
(
'
But soft, what light through yonder
chimney
breaks?
'
).
up
()
.
c
(
'
replace
'
,
{
'
id
'
:
msg_id
,
'
xmlns
'
:
'
urn:xmpp:message-correct:0
'
}).
tree
());
expect
(
chatboxview
.
el
.
querySelectorAll
(
'
.chat-msg
'
).
length
).
toBe
(
1
);
test_utils
.
waitUntil
(()
=>
chatboxview
.
el
.
querySelector
(
'
.chat-msg-text
'
).
textContent
===
'
But soft, what light through yonder window breaks?
'
).
then
(()
=>
{
'
But soft, what light through yonder chimney breaks?
'
).
then
(()
=>
{
expect
(
chatboxview
.
el
.
querySelectorAll
(
'
.chat-msg
'
).
length
).
toBe
(
1
);
expect
(
chatboxview
.
el
.
querySelectorAll
(
'
.chat-msg-content .fa-edit
'
).
length
).
toBe
(
1
);
_converse
.
chatboxes
.
onMessage
(
$msg
({
'
from
'
:
sender_jid
,
'
to
'
:
_converse
.
connection
.
jid
,
'
type
'
:
'
chat
'
,
'
id
'
:
u
.
getUniqueId
(),
}).
c
(
'
body
'
).
t
(
'
But soft, what light through yonder window breaks?
'
).
up
()
.
c
(
'
replace
'
,
{
'
id
'
:
msg_id
,
'
xmlns
'
:
'
urn:xmpp:message-correct:0
'
}).
tree
());
return
test_utils
.
waitUntil
(()
=>
chatboxview
.
el
.
querySelector
(
'
.chat-msg-text
'
).
textContent
===
'
But soft, what light through yonder window breaks?
'
);
}).
then
(()
=>
{
expect
(
chatboxview
.
el
.
querySelectorAll
(
'
.chat-msg
'
).
length
).
toBe
(
1
);
expect
(
chatboxview
.
el
.
querySelectorAll
(
'
.chat-msg-content .fa-edit
'
).
length
).
toBe
(
1
);
chatboxview
.
el
.
querySelector
(
'
.chat-msg-content .fa-edit
'
).
click
();
const
modal
=
chatboxview
.
model
.
messages
.
at
(
0
).
message_versions_modal
;
return
test_utils
.
waitUntil
(()
=>
u
.
isVisible
(
modal
.
el
),
1000
);
}).
then
(()
=>
{
const
modal
=
chatboxview
.
model
.
messages
.
at
(
0
).
message_versions_modal
;
const
older_msgs
=
modal
.
el
.
querySelectorAll
(
'
.older-msg
'
);
expect
(
older_msgs
.
length
).
toBe
(
2
);
expect
(
older_msgs
[
0
].
textContent
).
toBe
(
'
But soft, what light through yonder airlock breaks?
'
);
expect
(
older_msgs
[
1
].
textContent
).
toBe
(
'
But soft, what light through yonder chimney breaks?
'
);
done
();
});
}));
...
...
src/converse-message-view.js
View file @
f3f58a8d
...
...
@@ -94,6 +94,7 @@
this
.
model
.
on
(
'
change:progress
'
,
this
.
renderFileUploadProgresBar
,
this
);
this
.
model
.
on
(
'
change:type
'
,
this
.
render
,
this
);
this
.
model
.
on
(
'
change:upload
'
,
this
.
render
,
this
);
this
.
model
.
on
(
'
change:message
'
,
this
.
render
,
this
);
this
.
model
.
on
(
'
destroy
'
,
this
.
remove
,
this
);
this
.
render
();
},
...
...
@@ -232,10 +233,10 @@
showMessageVersionsModal
(
ev
)
{
ev
.
preventDefault
();
if
(
_
.
isUndefined
(
this
.
message_versions_modal
))
{
this
.
message_versions_modal
=
new
_converse
.
MessageVersionsModal
({
'
model
'
:
this
.
model
});
if
(
_
.
isUndefined
(
this
.
m
odel
.
m
essage_versions_modal
))
{
this
.
m
odel
.
m
essage_versions_modal
=
new
_converse
.
MessageVersionsModal
({
'
model
'
:
this
.
model
});
}
this
.
message_versions_modal
.
show
(
ev
);
this
.
m
odel
.
m
essage_versions_modal
.
show
(
ev
);
},
isMeCommand
()
{
...
...
src/templates/message_versions_modal.html
View file @
f3f58a8d
...
...
@@ -7,7 +7,7 @@
</div>
<div
class=
"modal-body"
>
<h4>
Older versions
</h4>
{[o.older_versions.forEach(function (text) { ]}
<p>
{{{text}}}
</p>
{[ }); ]}
{[o.older_versions.forEach(function (text) { ]}
<p
class=
"older-msg"
>
{{{text}}}
</p>
{[ }); ]}
<hr>
<h4>
Current version
</h4>
<p>
{{{o.message}}}
</p>
...
...
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