Fix join team for anon users

This commit is contained in:
yflory
2019-12-18 13:05:01 +01:00
parent 8eed376274
commit a817242fe5
6 changed files with 33 additions and 2 deletions

View File

@@ -779,6 +779,11 @@ define([
postMessage("SEND_FRIEND_REQUEST", data, cb);
};
// Team
common.anonGetPreviewContent = function (data, cb) {
postMessage("ANON_GET_PREVIEW_CONTENT", data, cb);
};
// Onlyoffice
var onlyoffice = common.onlyoffice = {};
onlyoffice.execCommand = function (data, cb) {

View File

@@ -1273,6 +1273,12 @@ define([
});
};
Store.anonGetPreviewContent = function (clientId, data, cb) {
Team.anonGetPreviewContent({
store: store
}, data, cb);
};
// Get hashes for the share button
// If we can find a stronger hash
Store.getStrongerHash = function (clientId, data, _cb) {

View File

@@ -60,6 +60,8 @@ define([
// Messaging
ANSWER_FRIEND_REQUEST: Store.answerFriendRequest,
SEND_FRIEND_REQUEST: Store.sendFriendRequest,
// Team invitation
ANON_GET_PREVIEW_CONTENT: Store.anonGetPreviewContent,
// OnlyOffice
OO_COMMAND: Store.onlyoffice.execCommand,
// Cursor

View File

@@ -1684,6 +1684,10 @@ define([
return team;
};
Team.anonGetPreviewContent = function (cfg, data, cb) {
getPreviewContent(cfg, data, null, cb);
};
return Team;
});

View File

@@ -675,6 +675,10 @@ define([
Cryptpad.messaging.answerFriendRequest(data, cb);
});
sframeChan.on('Q_ANON_GET_PREVIEW_CONTENT', function (data, cb) {
Cryptpad.anonGetPreviewContent(data, cb);
});
// History
sframeChan.on('Q_GET_FULL_HISTORY', function (data, cb) {
var crypto = Crypto.createEncryptor(secret.keys);