mirror of https://github.com/xwiki-labs/cryptpad
Fix form anonymous responses not triggering the notification
This commit is contained in:
parent
614d3834a3
commit
51c50db166
|
@ -1955,7 +1955,7 @@ define([
|
|||
// If send is true, send the request to the owner.
|
||||
if (owner) {
|
||||
if (data.send) {
|
||||
store.mailbox.sendTo(data.query, {
|
||||
Mailbox.sendToAnon(store.anon_rpc, data.query, {
|
||||
channel: data.channel,
|
||||
data: data.msgData
|
||||
}, {
|
||||
|
|
|
@ -164,6 +164,22 @@ proxy.mailboxes = {
|
|||
});
|
||||
});
|
||||
};
|
||||
Mailbox.sendToAnon = function (anonRpc, type, msg, user, cb) {
|
||||
var Nacl = Crypto.Nacl;
|
||||
var curveSeed = Nacl.randomBytes(32);
|
||||
var curvePair = Nacl.box.keyPair.fromSecretKey(new Uint8Array(curveSeed));
|
||||
var curvePrivate = Nacl.util.encodeBase64(curvePair.secretKey);
|
||||
var curvePublic = Nacl.util.encodeBase64(curvePair.publicKey);
|
||||
sendTo({
|
||||
store: {
|
||||
anon_rpc: anonRpc,
|
||||
proxy: {
|
||||
curvePrivate: curvePrivate,
|
||||
curvePublic: curvePublic
|
||||
}
|
||||
}
|
||||
}, type, msg, user, cb);
|
||||
};
|
||||
|
||||
// Mark a message as read
|
||||
var dismiss = function (ctx, data, cId, cb) {
|
||||
|
|
Loading…
Reference in New Issue