Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
matrix-js-sdk
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Analyze
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
GitHub Mirror
Matrix.org
matrix-js-sdk
Commits
c7ba8c01
Commit
c7ba8c01
authored
7 years ago
by
Luke Barnard
Browse files
Options
Downloads
Patches
Plain Diff
Fix more comments
parent
742148a0
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/models/event.js
+5
-1
5 additions, 1 deletion
src/models/event.js
with
5 additions
and
1 deletion
src/models/event.js
+
5
−
1
View file @
c7ba8c01
...
...
@@ -349,7 +349,7 @@ utils.extend(module.exports.MatrixEvent.prototype, {
* attempt is completed.
*/
attemptDecryption
:
async
function
(
crypto
,
cancelAndRetry
=
false
)
{
//
start with a couple of sanity checks.
//
If this event isn't encrypted, decryption will fail so throw early
if
(
!
this
.
isEncrypted
())
{
throw
new
Error
(
"
Attempt to decrypt event which isn't encrypted
"
);
}
...
...
@@ -364,6 +364,10 @@ utils.extend(module.exports.MatrixEvent.prototype, {
});
}
// Don't attempt to decrypt an event which has already been encrypted,
// unless cancelAndRetry is true, in which case we allow a retry
// because we've just cancelled the room key request and can expect a
// new request to be started when we fail to decrypt again.
if
(
!
cancelAndRetry
&&
(
this
.
_clearEvent
&&
this
.
_clearEvent
.
content
&&
this
.
_clearEvent
.
content
.
msgtype
!==
"
m.bad.encrypted
"
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment