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
b77d76b3
Commit
b77d76b3
authored
Jul 10, 2015
by
JC Brand
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Started adding the API for querying archived messages.
parent
eeeaddbe
Changes
3
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
256 additions
and
11 deletions
+256
-11
converse.js
converse.js
+42
-0
main.js
main.js
+1
-1
spec/mam.js
spec/mam.js
+213
-10
No files found.
converse.js
View file @
b77d76b3
...
...
@@ -160,6 +160,7 @@
Strophe
.
addNamespace
(
'
MUC_USER
'
,
Strophe
.
NS
.
MUC
+
"
#user
"
);
Strophe
.
addNamespace
(
'
REGISTER
'
,
'
jabber:iq:register
'
);
Strophe
.
addNamespace
(
'
ROSTERX
'
,
'
http://jabber.org/protocol/rosterx
'
);
Strophe
.
addNamespace
(
'
RSM
'
,
'
http://jabber.org/protocol/rsm
'
);
Strophe
.
addNamespace
(
'
XFORM
'
,
'
jabber:x:data
'
);
// Add Strophe Statuses
...
...
@@ -6106,6 +6107,47 @@
return
_
.
map
(
jids
,
getWrappedChatBox
);
}
},
'
archive
'
:
{
'
query
'
:
function
(
options
,
callback
,
errback
)
{
var
date
;
// Available options are jid, limit, start, end, after, before
if
(
typeof
options
==
"
function
"
)
{
callback
=
options
;
errback
=
callback
;
}
if
(
!
converse
.
features
.
findWhere
({
'
var
'
:
Strophe
.
NS
.
MAM
}))
{
throw
new
Error
(
'
This server does not support XEP-0313, Message Archive Management
'
);
}
var
stanza
=
$iq
({
'
type
'
:
'
set
'
}).
c
(
'
query
'
,
{
'
xmlns
'
:
Strophe
.
NS
.
MAM
,
'
queryid
'
:
converse
.
connection
.
getUniqueId
()});
if
(
typeof
options
!=
"
undefined
"
)
{
stanza
.
c
(
'
x
'
,
{
'
xmlns
'
:
'
jabber:x:data
'
})
.
c
(
'
field
'
,
{
'
var
'
:
'
FORM_TYPE
'
})
.
c
(
'
value
'
).
t
(
Strophe
.
NS
.
MAM
).
up
().
up
();
if
(
options
.
jid
)
{
stanza
.
c
(
'
field
'
,
{
'
var
'
:
'
with
'
}).
c
(
'
value
'
).
t
(
options
.
jid
).
up
().
up
();
}
_
.
each
([
'
start
'
,
'
end
'
],
function
(
t
)
{
if
(
options
[
t
])
{
date
=
moment
(
options
[
t
]);
if
(
date
.
isValid
())
{
stanza
.
c
(
'
field
'
,
{
'
var
'
:
t
}).
c
(
'
value
'
).
t
(
date
.
format
()).
up
().
up
();
}
else
{
throw
new
TypeError
(
'
archive.query: invalid date provided for:
'
+
t
);
}
}
});
stanza
.
up
();
if
(
options
.
limit
)
{
stanza
.
c
(
'
set
'
,
{
'
xmlns
'
:
Strophe
.
NS
.
RSM
}).
c
(
'
max
'
).
t
(
options
.
limit
).
up
();
}
if
(
options
.
after
)
{
stanza
.
c
(
'
after
'
).
t
(
options
.
after
).
up
();
}
}
converse
.
connection
.
sendIQ
(
stanza
,
callback
,
errback
);
}
},
'
rooms
'
:
{
'
open
'
:
function
(
jids
,
nick
)
{
if
(
!
nick
)
{
...
...
main.js
View file @
b77d76b3
...
...
@@ -26,7 +26,7 @@ require.config({
"
jquery-private
"
:
"
src/jquery-private
"
,
"
jquery.browser
"
:
"
components/jquery.browser/dist/jquery.browser
"
,
"
jquery.easing
"
:
"
components/jquery-easing-original/index
"
,
// XXX: Only required for https://conversejs.org website
"
moment
"
:
"
components/momentjs/m
in/moment.min
"
,
"
moment
"
:
"
components/momentjs/m
oment
"
,
"
strophe-base64
"
:
"
components/strophejs/src/base64
"
,
"
strophe-bosh
"
:
"
components/strophejs/src/bosh
"
,
"
strophe-core
"
:
"
components/strophejs/src/core
"
,
...
...
spec/mam.js
View file @
b77d76b3
This diff is collapsed.
Click to expand it.
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