Get the pad data from team drives when mentionned in a comment

pull/1/head
yflory 5 years ago
parent bafe4718ef
commit 977301dfc3

@ -528,7 +528,7 @@ define([
/////////////////////// Store ////////////////////////////////////
//////////////////////////////////////////////////////////////////
var getAllStores = function () {
var getAllStores = Store.getAllStores = function () {
var stores = [store];
var teamModule = store.modules['team'];
if (teamModule) {
@ -2307,6 +2307,7 @@ define([
return;
}
store.mailbox = Mailbox.init({
Store: Store,
store: store,
updateMetadata: function () {
broadcast([], "UPDATE_METADATA");
@ -2415,7 +2416,6 @@ define([
loadUniversal(Profile, 'profile', waitFor);
loadUniversal(Team, 'team', waitFor);
loadUniversal(History, 'history', waitFor);
loadMailbox(waitFor);
cleanFriendRequests();
}).nThen(function () {
var requestLogin = function () {
@ -2506,6 +2506,8 @@ define([
proxy.on('change', [Constants.tokenKey], function () {
broadcast([], "UPDATE_TOKEN", { token: proxy[Constants.tokenKey] });
});
loadMailbox();
});
};

@ -541,15 +541,18 @@ define([
var channel = content.channel;
if (!channel) { return void cb(true); }
var res = ctx.store.manager.findChannel(channel);
var title, href;
ctx.Store.getAllStores().some(function (s) {
var res = s.manager.findChannel(channel);
// Check if the pad is in our drive
res.some(function (obj) {
return res.some(function (obj) {
if (!obj.data) { return; }
if (href && !obj.data.href) { return; } // We already have the VIEW url, we need EDIT
href = obj.data.href || obj.data.roHref;
title = obj.data.filename || obj.data.title;
return true;
if (obj.data.href) { return true; } // Abort only if we have the EDIT url
});
});
// If we don't have the edit url, ignore this notification
@ -597,12 +600,16 @@ define([
var res = ctx.store.manager.findChannel(channel);
var title, href;
ctx.Store.getAllStores().some(function (s) {
var res = s.manager.findChannel(channel);
// Check if the pad is in our drive
res.some(function (obj) {
return res.some(function (obj) {
if (!obj.data) { return; }
if (href && !obj.data.href) { return; } // We already have the VIEW url, we need EDIT
href = obj.data.href || obj.data.roHref;
title = obj.data.filename || obj.data.title;
return true;
if (obj.data.href) { return true; } // Abort only if we have the EDIT url
});
});
// Add the title

@ -431,6 +431,7 @@ proxy.mailboxes = {
var mailbox = {};
var store = cfg.store;
var ctx = {
Store: cfg.Store,
store: store,
pinPads: cfg.pinPads,
updateMetadata: cfg.updateMetadata,

Loading…
Cancel
Save