mirror of
https://github.com/wekan/wekan.git
synced 2025-12-16 15:30:13 +01:00
Restore Meteot 1.4 version of sandstorm.js
This commit is contained in:
parent
eb9d417a27
commit
6e8a84eaa7
1 changed files with 6 additions and 6 deletions
12
sandstorm.js
12
sandstorm.js
|
|
@ -22,7 +22,7 @@ const sandstormBoard = {
|
||||||
|
|
||||||
if (isSandstorm && Meteor.isServer) {
|
if (isSandstorm && Meteor.isServer) {
|
||||||
const fs = require('fs');
|
const fs = require('fs');
|
||||||
const Capnp = require("/node_modules/capnp.js");
|
const Capnp = require('capnp');
|
||||||
const Package = Capnp.importSystem('sandstorm/package.capnp');
|
const Package = Capnp.importSystem('sandstorm/package.capnp');
|
||||||
const Powerbox = Capnp.importSystem('sandstorm/powerbox.capnp');
|
const Powerbox = Capnp.importSystem('sandstorm/powerbox.capnp');
|
||||||
const Identity = Capnp.importSystem('sandstorm/identity.capnp');
|
const Identity = Capnp.importSystem('sandstorm/identity.capnp');
|
||||||
|
|
@ -73,7 +73,7 @@ if (isSandstorm && Meteor.isServer) {
|
||||||
session.claimRequest(token).then((response) => {
|
session.claimRequest(token).then((response) => {
|
||||||
const identity = response.cap.castAs(Identity.Identity);
|
const identity = response.cap.castAs(Identity.Identity);
|
||||||
const promises = [api.getIdentityId(identity), identity.getProfile(),
|
const promises = [api.getIdentityId(identity), identity.getProfile(),
|
||||||
httpBridge.saveIdentity(identity)];
|
httpBridge.saveIdentity(identity)];
|
||||||
return Promise.all(promises).then((responses) => {
|
return Promise.all(promises).then((responses) => {
|
||||||
const identityId = responses[0].id.toString('hex').slice(0, 32);
|
const identityId = responses[0].id.toString('hex').slice(0, 32);
|
||||||
const profile = responses[1].profile;
|
const profile = responses[1].profile;
|
||||||
|
|
@ -113,9 +113,9 @@ if (isSandstorm && Meteor.isServer) {
|
||||||
const identity = response.identity;
|
const identity = response.identity;
|
||||||
return identity.getProfile().then(() => {
|
return identity.getProfile().then(() => {
|
||||||
return { identity,
|
return { identity,
|
||||||
mentioned: !!user.mentioned,
|
mentioned: !!user.mentioned,
|
||||||
subscribed: !!user.subscribed,
|
subscribed: !!user.subscribed,
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
}).catch(() => {
|
}).catch(() => {
|
||||||
// Ignore identities that fail to restore. Either they were added before we set
|
// Ignore identities that fail to restore. Either they were added before we set
|
||||||
|
|
@ -130,7 +130,7 @@ if (isSandstorm && Meteor.isServer) {
|
||||||
|
|
||||||
return session.activity(event);
|
return session.activity(event);
|
||||||
}).then(() => done(),
|
}).then(() => done(),
|
||||||
(e) => done(e));
|
(e) => done(e));
|
||||||
})();
|
})();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue