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
c8def35a
Commit
c8def35a
authored
Mar 22, 2013
by
JC Brand
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove xmppchat.ClientStorage, it's not being used anymore
parent
6fe5ac72
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
0 additions
and
51 deletions
+0
-51
converse.js
converse.js
+0
-51
No files found.
converse.js
View file @
c8def35a
...
...
@@ -206,55 +206,6 @@
});
};
xmppchat
.
ClientStorage
=
Backbone
.
Model
.
extend
({
initialize
:
function
(
own_jid
)
{
this
.
set
({
'
own_jid
'
:
own_jid
});
},
addMessage
:
function
(
jid
,
msg
,
direction
)
{
var
bare_jid
=
Strophe
.
getBareJidFromJid
(
jid
),
now
=
xmppchat
.
toISOString
(
new
Date
()),
msgs
=
store
.
get
(
hex_sha1
(
this
.
get
(
'
own_jid
'
)
+
bare_jid
))
||
[];
if
(
msgs
.
length
>=
30
)
{
msgs
.
shift
();
}
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
),
decrypted_msgs
=
[],
i
;
var
msgs
=
store
.
get
(
hex_sha1
(
this
.
get
(
'
own_jid
'
)
+
bare_jid
))
||
[],
msgs_length
=
msgs
.
length
;
for
(
i
=
0
;
i
<
msgs_length
;
i
++
)
{
decrypted_msgs
.
push
(
sjcl
.
decrypt
(
hex_sha1
(
this
.
get
(
'
own_jid
'
)),
msgs
[
i
]));
}
return
decrypted_msgs
;
},
getLastMessage
:
function
(
jid
)
{
var
bare_jid
=
Strophe
.
getBareJidFromJid
(
jid
);
var
msgs
=
store
.
get
(
hex_sha1
(
this
.
get
(
'
own_jid
'
)
+
bare_jid
))
||
[];
if
(
msgs
.
length
)
{
return
sjcl
.
decrypt
(
hex_sha1
(
this
.
get
(
'
own_jid
'
)),
msgs
[
msgs
.
length
-
1
]);
}
return
undefined
;
},
clearMessages
:
function
(
jid
)
{
var
bare_jid
=
Strophe
.
getBareJidFromJid
(
jid
);
store
.
set
(
hex_sha1
(
this
.
get
(
'
own_jid
'
)
+
bare_jid
),
[]);
},
flush
:
function
()
{
// Clears all localstorage content handled by burry.js
// Only used in tests
store
.
flush
();
}
});
xmppchat
.
Message
=
Backbone
.
Model
.
extend
();
xmppchat
.
Messages
=
Backbone
.
Collection
.
extend
({
...
...
@@ -432,7 +383,6 @@
if
(
match
[
1
]
===
"
clear
"
)
{
this
.
$el
.
find
(
'
.chat-content
'
).
empty
();
this
.
model
.
messages
.
reset
()
// xmppchat.storage.clearMessages(bare_jid);
return
;
}
else
if
(
match
[
1
]
===
"
help
"
)
{
...
...
@@ -2076,7 +2026,6 @@
this
.
connection
.
bare_jid
=
Strophe
.
getBareJidFromJid
(
this
.
connection
.
jid
);
this
.
connection
.
domain
=
Strophe
.
getDomainFromJid
(
this
.
connection
.
jid
);
this
.
connection
.
muc_domain
=
'
conference.
'
+
this
.
connection
.
domain
;
this
.
storage
=
new
this
.
ClientStorage
(
hex_sha1
(
this
.
connection
.
bare_jid
));
this
.
chatboxes
.
localStorage
=
new
Backbone
.
LocalStorage
(
hex_sha1
(
'
converse.chatboxes-
'
+
xmppchat
.
connection
.
bare_jid
));
...
...
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