Commit 21178add authored by JC Brand's avatar JC Brand

Remove converse-otr

parent 4f8b5a40
......@@ -8,6 +8,7 @@
- #194 Include entity capabilities in outgoing presence stanzas
- #337 API call to update a VCard
- #421 XEP-0308: Last Message Correction
- #497 XEP-0384: OMEMO encrypted messaging
- #968 Use nickname from VCard when joining a room
- #1091 There's now only one CSS file for all view modes.
- #1094 Show room members who aren't currently online
......@@ -60,8 +61,7 @@
[statusMessageChanged](https://conversejs.org/docs/html/events.html#contactstatusmessagechanged)
event and make the XMLHttpRequest yourself.
- Removed `xhr_user_search` in favor of only accepting `xhr_user_search_url` as configuration option.
- `xhr_user_search_url` has to include the `?` character now in favor of more
flexibility. See example in the documentation.
- `xhr_user_search_url` has to include the `?` character now in favor of more flexibility. See example in the documentation.
- The data returned from the `xhr_user_search_url` must now include the user's
`jid` instead of just an `id`.
- New configuration settings [nickname](https://conversejs.org/docs/html/configurations.html#nickname)
......@@ -76,6 +76,9 @@ flexibility. See example in the documentation.
roster-related data. Previously this code was in `converse-core.js`.
- VCards are now stored separately from chats and roster contacts.
## Other
- Support for OTR (off-the-record) encryption has been dropped.
## 3.3.4 (2018-03-05)
......
......@@ -12466,15 +12466,6 @@
"integrity": "sha1-u+Z0BseaqFxc/sdm/lc0VV36EnQ=",
"dev": true
},
"otr": {
"version": "0.2.16",
"resolved": "https://registry.npmjs.org/otr/-/otr-0.2.16.tgz",
"integrity": "sha1-BKdTRPUi38sHeMVDjA9V5p0+i8E=",
"dev": true,
"requires": {
"webworker-threads": "0.4.13"
}
},
"output-file-sync": {
"version": "2.0.1",
"resolved": "https://registry.npmjs.org/output-file-sync/-/output-file-sync-2.0.1.tgz",
......@@ -15130,25 +15121,6 @@
}
}
},
"webworker-threads": {
"version": "0.4.13",
"resolved": "https://registry.npmjs.org/webworker-threads/-/webworker-threads-0.4.13.tgz",
"integrity": "sha1-1zvf0AIb9wkxy4XCTMP0zvvrH5g=",
"dev": true,
"optional": true,
"requires": {
"nan": "0.8.0"
},
"dependencies": {
"nan": {
"version": "0.8.0",
"resolved": "https://registry.npmjs.org/nan/-/nan-0.8.0.tgz",
"integrity": "sha1-AiqPpen+hCCWSsH7PclOF/RJ9f0=",
"dev": true,
"optional": true
}
}
},
"which": {
"version": "1.0.5",
"resolved": "https://registry.npmjs.org/which/-/which-1.0.5.tgz",
......
......@@ -71,7 +71,6 @@
"minimist": "^1.2.0",
"moment": "~> 2.19.3 ",
"npm": "^5.7.1",
"otr": "0.2.16",
"pluggable.js": "2.0.0",
"po2json": "^0.4.4",
"protobufjs": "5.0.1",
......
(function (root, factory) {
define(["jquery", "jasmine", "mock", "test-utils"], factory);
} (this, function ($, jasmine, mock, test_utils) {
var Strophe = converse.env.Strophe;
var b64_sha1 = converse.env.b64_sha1;
var $pres = converse.env.$pres;
var _ = converse.env._;
describe("A chatbox", function() {
it("contains a button for starting an encrypted chat session",
mock.initConverseWithPromises(
null, ['rosterGroupsFetched'], {},
function (done, _converse) {
var timeout = true, $toolbar, view;
test_utils.createContacts(_converse, 'current');
test_utils.openControlBox();
test_utils.waitUntil(function () {
return $(_converse.rosterview.el).find('.roster-group').length;
}, 300).then(function () {
// TODO: More tests can be added here...
var contact_jid = mock.cur_names[2].replace(/ /g,'.').toLowerCase() + '@localhost';
test_utils.openChatBoxFor(_converse, contact_jid);
view = _converse.chatboxviews.get(contact_jid);
$toolbar = $(view.el).find('ul.chat-toolbar');
expect($toolbar.find('.toggle-otr').length).toBe(1);
// Register spies
spyOn(view, 'toggleOTRMenu').and.callThrough();
view.delegateEvents(); // We need to rebind all events otherwise our spy won't be called
timeout = false;
$toolbar[0].querySelector('.toggle-otr').click();
return test_utils.waitUntil(function () {
return view.el.querySelector('.otr-menu').offsetHeight;
}, 300)
}).then(function () {
expect(view.toggleOTRMenu).toHaveBeenCalled();
done();
});
}));
describe("with an active OTR session", function() {
it("will not show the spoiler toolbar button",
mock.initConverseWithPromises(
null, ['rosterGroupsFetched'], {},
function (done, _converse) {
test_utils.createContacts(_converse, 'current');
var contact_jid = mock.cur_names[0].replace(/ /g,'.').toLowerCase() + '@localhost';
// XXX: We need to send a presence from the contact, so that we
// have a resource, that resource is then queried to see
// whether Strophe.NS.SPOILER is supported, in which case
// the spoiler button will appear.
var presence = $pres({
'from': contact_jid+'/phone',
'to': 'dummy@localhost'
});
_converse.connection._dataRecv(test_utils.createRequest(presence));
test_utils.openChatBoxFor(_converse, contact_jid);
test_utils.waitUntilDiscoConfirmed(_converse, contact_jid+'/phone', [], [Strophe.NS.SPOILER]).then(function () {
var spoiler_toggle;
var view = _converse.chatboxviews.get(contact_jid);
spyOn(view, 'addSpoilerButton').and.callThrough();
view.model.set('otr_status', 1);
test_utils.waitUntil(function () {
return _.isNull(view.el.querySelector('.toggle-compose-spoiler'));
}).then(function () {
spoiler_toggle = view.el.querySelector('.toggle-compose-spoiler');
expect(spoiler_toggle).toBe(null);
view.model.set('otr_status', 3);
return test_utils.waitUntil(function () {
return !_.isNull(view.el.querySelector('.toggle-compose-spoiler'));
});
}).then(function () {
spoiler_toggle = view.el.querySelector('.toggle-compose-spoiler');
expect(spoiler_toggle).not.toBe(null);
view.model.set('otr_status', 2);
return test_utils.waitUntil(function () {
return _.isNull(view.el.querySelector('.toggle-compose-spoiler'));
});
}).then(function () {
spoiler_toggle = view.el.querySelector('.toggle-compose-spoiler');
expect(spoiler_toggle).toBe(null);
view.model.set('otr_status', 4);
return test_utils.waitUntil(function () {
return !_.isNull(view.el.querySelector('.toggle-compose-spoiler'));
});
}).then(function () {
spoiler_toggle = view.el.querySelector('.toggle-compose-spoiler');
expect(spoiler_toggle).not.toBe(null);
done();
});
});
}));
});
});
describe("The OTR module", function() {
it("will add processing hints to sent out encrypted <message> stanzas",
mock.initConverseWithPromises(
null, ['rosterGroupsFetched'], {},
function (done, _converse) {
test_utils.openControlBox();
test_utils.createContacts(_converse, 'current');
var UNVERIFIED = 1, UNENCRYPTED = 0;
var contact_name = mock.cur_names[0];
var contact_jid = contact_name.replace(/ /g,'.').toLowerCase() + '@localhost';
test_utils.openChatBoxFor(_converse, contact_jid);
var chatview = _converse.chatboxviews.get(contact_jid);
chatview.model.set('otr_status', UNVERIFIED);
var stanza = chatview.model.createMessageStanza(new _converse.Message({ message: 'hello world'}));
var $hints = $(stanza.nodeTree).find('[xmlns="'+Strophe.NS.HINTS+'"]');
expect($hints.length).toBe(3);
expect($hints.get(0).tagName).toBe('no-store');
expect($hints.get(1).tagName).toBe('no-permanent-store');
expect($hints.get(2).tagName).toBe('no-copy');
chatview.model.set('otr_status', UNENCRYPTED); // Reset again to UNENCRYPTED
done();
}));
describe("An OTR Chat Message", function () {
it("will not be carbon copied when it's sent out",
mock.initConverseWithPromises(
null, ['rosterGroupsFetched'], {},
function (done, _converse) {
test_utils.openControlBox();
test_utils.createContacts(_converse, 'current');
var msgtext = "?OTR,1,3,?OTR:AAIDAAAAAAEAAAABAAAAwCQ8HKsag0y0DGKsneo0kzKu1ua5L93M4UKTkCf1I2kbm2RgS5kIxDTxrTj3wVRB+H5Si86E1fKtuBgsDf/bKkGTM0h/49vh5lOD9HkE8cnSrFEn5GN,";
var sender_jid = mock.cur_names[3].replace(/ /g,'.').toLowerCase() + '@localhost';
_converse.api.chats.open(sender_jid);
var chatbox = _converse.chatboxes.get(sender_jid);
spyOn(_converse.connection, 'send');
chatbox.set('otr_status', 1); // Set OTR status to UNVERIFIED, to mock an encrypted session
chatbox.sendMessage(new _converse.Message({'message': msgtext}));
var $sent = $(_converse.connection.send.calls.argsFor(0)[0].tree());
expect($sent.find('body').siblings('private').length).toBe(1);
expect($sent.find('private').length).toBe(1);
expect($sent.find('private').attr('xmlns')).toBe('urn:xmpp:carbons:2');
chatbox.set('otr_status', 0); // Reset again to UNENCRYPTED
done();
}));
});
});
}));
This diff is collapsed.
......@@ -48,6 +48,5 @@
define('backbone.noconflict', [], function () { return Backbone; });
define('backbone.browserStorage', ['backbone'], emptyFunction);
define('backbone.overview', ['backbone'], emptyFunction);
define('otr', [], function () { return { 'DSA': DSA, 'OTR': OTR };});
return require('converse');
}));
{[ if (o.allow_otr) { ]}
<li class="toggle-toolbar-menu dropup right" title="{{{o.otr_tooltip}}}">
<a class="toggle-otr {{{o.otr_status_class}}}" title="{{{o.label_insert_smiley}}}" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
<span class="chat-toolbar-text">{{{o.otr_translated_status}}}</span>
{[ if (o.otr_status == o.UNENCRYPTED) { ]}
<span class="fa fa-unlock"></span>
{[ } ]}
{[ if (o.otr_status == o.UNVERIFIED) { ]}
<span class="fa fa-lock"></span>
{[ } ]}
{[ if (o.otr_status == o.VERIFIED) { ]}
<span class="fa fa-lock"></span>
{[ } ]} {[ if (o.otr_status == o.FINISHED) { ]}
<span class="fa fa-unlock"></span>
{[ } ]}
</a>
<ul class="otr-menu toolbar-menu dropdown-menu">
{[ if (o.otr_status == o.UNENCRYPTED) { ]}
<li class="dropdown-item"><a class="start-otr" href="#">{{{o.label_start_encrypted_conversation}}}</a></li>
{[ } ]}
{[ if (o.otr_status != o.UNENCRYPTED) { ]}
<li class="dropdown-item"><a class="start-otr" href="#">{{{o.label_refresh_encrypted_conversation}}}</a></li>
<li class="dropdown-item"><a class="end-otr" href="#">{{{o.label_end_encrypted_conversation}}}</a></li>
<li class="dropdown-item"><a class="auth-otr" data-scheme="smp" href="#">{{{o.label_verify_with_smp}}}</a></li>
{[ } ]}
{[ if (o.otr_status == o.UNVERIFIED) { ]}
<li class="dropdown-item"><a class="auth-otr" data-scheme="fingerprint" href="#">{{{o.label_verify_with_fingerprints}}}</a></li>
{[ } ]}
<li class="dropdown-item"><a href="http://www.cypherpunks.ca/otr/help/3.2.0/levels.php" target="_blank" rel="noopener">{{{o.label_whats_this}}}</a></li>
</ul>
</li>
{[ } ]}
......@@ -558,12 +558,6 @@
!attrs['message'];
};
u.isOTRMessage = function (message) {
var body = message.querySelector('body'),
text = (!_.isNull(body) ? body.textContent: undefined);
return text && !!text.match(/^\?OTR/);
};
u.isHeadlineMessage = function (_converse, message) {
var from_jid = message.getAttribute('from');
if (message.getAttribute('type') === 'headline') {
......
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