Friend requests with mailboxes

This commit is contained in:
yflory
2019-05-21 18:43:11 +02:00
parent 0732773bba
commit 991c56fec3
10 changed files with 326 additions and 368 deletions

View File

@@ -502,16 +502,11 @@ define([
});
// Messaging
sframeChan.on('Q_SEND_FRIEND_REQUEST', function (netfluxId, cb) {
Cryptpad.inviteFromUserlist(netfluxId, cb);
sframeChan.on('Q_SEND_FRIEND_REQUEST', function (data, cb) {
Cryptpad.messaging.sendFriendRequest(data, cb);
});
Cryptpad.messaging.onFriendRequest.reg(function (confirmText, cb) {
sframeChan.query('Q_INCOMING_FRIEND_REQUEST', confirmText, function (err, data) {
cb(data);
});
});
Cryptpad.messaging.onFriendComplete.reg(function (data) {
sframeChan.event('EV_FRIEND_REQUEST', data);
sframeChan.on('Q_ANSWER_FRIEND_REQUEST', function (data, cb) {
Cryptpad.messaging.answerFriendRequest(data, cb);
});
// History
@@ -954,9 +949,6 @@ define([
readOnly: readOnly,
crypto: Crypto.createEncryptor(secret.keys),
onConnect: function () {
var href = parsed.getUrl();
// Add friends requests handlers when we have the final href
Cryptpad.messaging.addHandlers(href);
if (window.location.hash && window.location.hash !== '#') {
/*window.location = parsed.getUrl({
present: parsed.hashData.present,