Share a channel id, not a hash
This commit is contained in:
parent
852b2eaf1d
commit
af31771e3a
@ -52,7 +52,7 @@ define([
|
|||||||
var createData = function (common, hash) {
|
var createData = function (common, hash) {
|
||||||
var proxy = common.getProxy();
|
var proxy = common.getProxy();
|
||||||
return {
|
return {
|
||||||
channelHash: hash || common.createRandomHash(),
|
channel: hash || common.createChannelId(),
|
||||||
displayName: proxy[common.displayNameKey],
|
displayName: proxy[common.displayNameKey],
|
||||||
profile: proxy.profile.view,
|
profile: proxy.profile.view,
|
||||||
edPublic: proxy.edPublic,
|
edPublic: proxy.edPublic,
|
||||||
@ -91,7 +91,7 @@ define([
|
|||||||
msg = ["FRIEND_REQ_NOK", chan];
|
msg = ["FRIEND_REQ_NOK", chan];
|
||||||
var existing = getFriend(common, msgData.edPublic);
|
var existing = getFriend(common, msgData.edPublic);
|
||||||
if (existing) {
|
if (existing) {
|
||||||
msg = ["FRIEND_REQ_OK", chan, createData(common, existing.channelHash)];
|
msg = ["FRIEND_REQ_OK", chan, createData(common, existing.channel)];
|
||||||
msgStr = Crypto.encrypt(JSON.stringify(msg), key);
|
msgStr = Crypto.encrypt(JSON.stringify(msg), key);
|
||||||
network.sendto(sender, msgStr);
|
network.sendto(sender, msgStr);
|
||||||
return;
|
return;
|
||||||
@ -99,7 +99,7 @@ define([
|
|||||||
common.confirm("Accept friend?", function (yes) { // XXX
|
common.confirm("Accept friend?", function (yes) { // XXX
|
||||||
if (yes) {
|
if (yes) {
|
||||||
pending[sender] = msgData;
|
pending[sender] = msgData;
|
||||||
msg = ["FRIEND_REQ_OK", chan, createData(common, msgData.channelHash)];
|
msg = ["FRIEND_REQ_OK", chan, createData(common, msgData.channel)];
|
||||||
}
|
}
|
||||||
msgStr = Crypto.encrypt(JSON.stringify(msg), key);
|
msgStr = Crypto.encrypt(JSON.stringify(msg), key);
|
||||||
network.sendto(sender, msgStr);
|
network.sendto(sender, msgStr);
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user