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
c1424373
Commit
c1424373
authored
Aug 27, 2018
by
JC Brand
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Create new message for correction if the original is not available
Fixes #1172
parent
3e7c8655
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
2 deletions
+10
-2
src/converse-chatboxes.js
src/converse-chatboxes.js
+10
-2
No files found.
src/converse-chatboxes.js
View file @
c1424373
...
...
@@ -295,8 +295,16 @@
const
replace
=
sizzle
(
`replace[xmlns="
${
Strophe
.
NS
.
MESSAGE_CORRECT
}
"]`
,
stanza
).
pop
();
if
(
replace
)
{
const
msgid
=
replace
&&
replace
.
getAttribute
(
'
id
'
)
||
stanza
.
getAttribute
(
'
id
'
),
message
=
msgid
&&
this
.
messages
.
findWhere
({
msgid
}),
older_versions
=
message
.
get
(
'
older_versions
'
)
||
[];
message
=
msgid
&&
this
.
messages
.
findWhere
({
msgid
});
if
(
!
message
)
{
// XXX: Looks like we received a correction for a
// non-existing message, probably due to MAM.
// Not clear what can be done about this... we'll
// just create it as a separate message for now.
return
false
;
}
const
older_versions
=
message
.
get
(
'
older_versions
'
)
||
[];
older_versions
.
push
(
message
.
get
(
'
message
'
));
message
.
save
({
'
message
'
:
_converse
.
chatboxes
.
getMessageBody
(
stanza
),
...
...
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