Merge branch 'mailbox' into staging

This commit is contained in:
yflory
2019-05-23 15:49:18 +02:00
17 changed files with 1135 additions and 294 deletions

View File

@@ -611,16 +611,6 @@ define([
});
};
// Messaging (manage friends from the userlist)
common.inviteFromUserlist = function (netfluxId, cb) {
postMessage("INVITE_FROM_USERLIST", {
netfluxId: netfluxId,
href: window.location.href
}, function (obj) {
if (obj && obj.error) { return void cb(obj.error); }
cb();
});
};
// Admin
common.adminRpc = function (data, cb) {
@@ -632,14 +622,13 @@ define([
common.onNetworkReconnect = Util.mkEvent();
common.onNewVersionReconnect = Util.mkEvent();
// Messaging
// Messaging (friend requests)
var messaging = common.messaging = {};
messaging.onFriendRequest = Util.mkEvent();
messaging.onFriendComplete = Util.mkEvent();
messaging.addHandlers = function (href) {
postMessage("ADD_DIRECT_MESSAGE_HANDLERS", {
href: href
});
messaging.answerFriendRequest = function (data, cb) {
postMessage("ANSWER_FRIEND_REQUEST", data, cb);
};
messaging.sendFriendRequest = function (data, cb) {
postMessage("SEND_FRIEND_REQUEST", data, cb);
};
// Onlyoffice
@@ -1088,9 +1077,6 @@ define([
var localToken = tryParsing(localStorage.getItem(Constants.tokenKey));
if (localToken !== data.token) { requestLogin(); }
},
// Messaging
Q_FRIEND_REQUEST: common.messaging.onFriendRequest.fire,
EV_FRIEND_COMPLETE: common.messaging.onFriendComplete.fire,
// Network
NETWORK_DISCONNECT: common.onNetworkDisconnect.fire,
NETWORK_RECONNECT: function (data) {