From 26a83003b5bfaf33a54076a3583dc27caeb625f9 Mon Sep 17 00:00:00 2001 From: yflory Date: Thu, 6 Jul 2017 14:27:13 +0200 Subject: [PATCH] Create an owned channel --- www/common/common-messaging.js | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/www/common/common-messaging.js b/www/common/common-messaging.js index d26d664dc..ee0c549fe 100644 --- a/www/common/common-messaging.js +++ b/www/common/common-messaging.js @@ -5,6 +5,22 @@ define([ var pending = {}; + Msg.createOwnedChannel = function (common, channelId, validateKey, owners, cb) { + var network = common.getNetwork(); + network.join(channelId).then(function (wc) { + var cfg = { + validateKey: validateKey, + owners: owners + }; + var msg = ['GET_HISTORY', wc.id, cfg]; + network.sendto(network.historyKeeper, JSON.stringify(msg)).then(cb, function (err) { + throw new Error(err); + }); + }, function (err) { + throw new Error(err); + }); + }; + // Remove should be called from the friend app at the moment // The other user will know it from the private channel ("REMOVE_FRIEND" message?) Msg.removeFromFriendList = function (common, edPublic, cb) {