Commit 1676258c authored by JC Brand's avatar JC Brand

Move the MAM features to a separate plugin.

parent da72be8f
......@@ -50,6 +50,7 @@ require.config({
"converse-controlbox": "src/converse-controlbox",
"converse-core": "src/converse-core",
"converse-headline": "src/converse-headline",
"converse-mam": "src/converse-mam",
"converse-muc": "src/converse-muc",
"converse-notification": "src/converse-notification",
"converse-otr": "src/converse-otr",
......@@ -228,6 +229,7 @@ if (typeof define !== 'undefined') {
// translations that you care about.
"converse-chatview", // Renders standalone chat boxes for single user chat
"converse-mam",
"converse-muc", // XEP-0045 Multi-user chat
"converse-otr", // Off-the-record encryption for one-on-one messages
"converse-controlbox", // The control box
......
......@@ -378,7 +378,7 @@
sent_stanza = iq;
IQ_id = sendIQ.bind(this)(iq, callback, errback);
});
spyOn(converse.features, 'onMAMPreferences').andCallThrough();
spyOn(converse, 'onMAMPreferences').andCallThrough();
var feature = new converse.Feature({
'var': Strophe.NS.MAM
......@@ -409,7 +409,7 @@
.c('never').c('jid').t('montague@montague.lit');
converse.connection._dataRecv(test_utils.createRequest(stanza));
expect(converse.features.onMAMPreferences).toHaveBeenCalled();
expect(converse.onMAMPreferences).toHaveBeenCalled();
expect(converse.connection.sendIQ.callCount).toBe(2);
expect(sent_stanza.toString()).toBe(
......
......@@ -122,9 +122,6 @@
return _.map(jids, _.partial(_.compose(converse.wrappedChatBox, converse.chatboxes.getChatBox.bind(converse.chatboxes)), _, true));
}
},
'archive': {
'query': converse.queryForArchivedMessages.bind(converse)
},
'tokens': {
'get': function (id) {
if (!converse.expose_rid_and_sid || typeof converse.connection === "undefined") {
......
This diff is collapsed.
......@@ -11,7 +11,7 @@
"converse-core",
"converse-api",
// TODO: remove this dependency
"converse-chat"
"converse-chatview"
], factory);
}(this, function (converse, converse_api) {
"use strict";
......
This diff is collapsed.
......@@ -887,7 +887,6 @@
onChatRoomMessage: function (message) {
var $message = $(message),
archive_id = $message.find('result[xmlns="'+Strophe.NS.MAM+'"]').attr('id'),
$forwarded = $message.find('forwarded'),
$delay;
......@@ -916,7 +915,7 @@
if (sender === '') {
return true;
}
this.model.createMessage($message, $delay, archive_id);
this.model.createMessage($message, $delay);
if (sender !== this.model.get('nick')) {
// We only emit an event if it's not our own message
converse.emit('message', message);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment