Enable friend requests from secure pads

This commit is contained in:
yflory
2017-08-28 16:21:05 +02:00
parent 147d88d845
commit 88cb4fd83c
7 changed files with 82 additions and 17 deletions

View File

@@ -104,7 +104,8 @@ define([
readOnly: readOnly,
availableHashes: hashes,
isTemplate: Cryptpad.isTemplate(window.location.href),
feedbackAllowed: Cryptpad.isFeedbackAllowed()
feedbackAllowed: Cryptpad.isFeedbackAllowed(),
friends: Cryptpad.getProxy().friends || {}
}
});
});
@@ -173,6 +174,18 @@ define([
Cryptpad.saveAsTemplate(Cryptget.put, data, cb);
});
sframeChan.on('Q_SEND_FRIEND_REQUEST', function (netfluxId, cb) {
Cryptpad.inviteFromUserlist(Cryptpad, netfluxId);
});
Cryptpad.onFriendRequest = function (confirmText, cb) {
sframeChan.query('Q_INCOMING_FRIEND_REQUEST', confirmText, function (err, data) {
cb(data);
});
};
Cryptpad.onFriendComplete = function (data) {
sframeChan.event('EV_FRIEND_REQUEST', data);
};
sframeChan.on('Q_GET_FULL_HISTORY', function (data, cb) {
var network = Cryptpad.getNetwork();
var hkn = network.historyKeeper;