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
bd2492e6
Commit
bd2492e6
authored
Oct 19, 2012
by
JC Brand
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Encrypt messages stored in localstorage.
parent
e235fa44
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
3 deletions
+8
-3
converse.js
converse.js
+8
-3
No files found.
converse.js
View file @
bd2492e6
...
...
@@ -109,13 +109,18 @@
if
(
msgs
.
length
>=
30
)
{
msgs
.
shift
();
}
msgs
.
push
(
now
+
'
'
+
direction
+
'
'
+
msg
);
msgs
.
push
(
sjcl
.
encrypt
(
hex_sha1
(
this
.
get
(
'
own_jid
'
)),
now
+
'
'
+
direction
+
'
'
+
msg
)
);
store
.
set
(
hex_sha1
(
this
.
get
(
'
own_jid
'
)
+
bare_jid
),
msgs
);
},
getMessages
:
function
(
jid
)
{
var
bare_jid
=
Strophe
.
getBareJidFromJid
(
jid
);
return
store
.
get
(
hex_sha1
(
this
.
get
(
'
own_jid
'
)
+
bare_jid
))
||
[];
var
bare_jid
=
Strophe
.
getBareJidFromJid
(
jid
),
decrypted_msgs
=
[];
var
msgs
=
store
.
get
(
hex_sha1
(
this
.
get
(
'
own_jid
'
)
+
bare_jid
))
||
[];
for
(
var
i
=
0
;
i
<
msgs
.
length
;
i
++
)
{
decrypted_msgs
.
push
(
sjcl
.
decrypt
(
hex_sha1
(
this
.
get
(
'
own_jid
'
)),
msgs
[
i
]));
}
return
decrypted_msgs
}
});
...
...
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