bug fix: send private value in topic creation

This commit is contained in:
or-else
2017-09-21 18:23:26 -07:00
parent e4a0b60f1e
commit 1f8d26a215
2 changed files with 51 additions and 21 deletions
+5 -6
View File
@@ -890,7 +890,7 @@
}
ctx.imageSmoothingEnabled = true;
ctx.drawImage(this, sx, sy, size, size, 0, 0, canvas.width, canvas.height);
var bits = canvas.toDataURL("image/jpg");
var bits = canvas.toDataURL("image/jpeg");
canvas = null;
instance.setState({dataUrl: bits});
@@ -1651,8 +1651,8 @@
this.props.onCreateTopic(sel, undefined);
}
},
handleGroupSubmit: function(name, dataUrl) {
this.props.onCreateTopic(undefined, vcard(name, dataUrl));
handleGroupSubmit: function(name, dataUrl, priv) {
this.props.onCreateTopic(undefined, vcard(name, dataUrl), priv);
},
handleGroupSubscribe: function(topicName) {
this.props.onCreateTopic(topicName);
@@ -3120,14 +3120,13 @@
this.setState({sidePanelSelected: 'new-topic'});
},
// Create of a new topic. New P2P topic requires peer's name.
handleNewTopicRequest: function(peerName, pub) {
handleNewTopicRequest: function(peerName, pub, priv) {
var instance = this;
var topic = peerName ? Tinode.newTopicWith(peerName) : Tinode.newTopic();
var query = topic.startMetaQuery().withDesc().withSub().withData();
var setParams;
if (!peerName) {
setParams = {desc: {public: pub}};
setParams = {desc: {public: pub, private: priv}};
}
topic.subscribe(query.build(), setParams).then(function() {