diff --git a/www/common/outer/async-store.js b/www/common/outer/async-store.js index fb1bcd202..012b5bec5 100644 --- a/www/common/outer/async-store.js +++ b/www/common/outer/async-store.js @@ -1170,9 +1170,6 @@ define([ onLeave: function (m) { channel.bcast("PAD_LEAVE", m); }, - onAbort: function () { - channel.bcast("PAD_DISCONNECT"); - }, onError: function (err) { channel.bcast("PAD_ERROR", err); delete channels[data.channel]; @@ -1181,7 +1178,11 @@ define([ channel.bcast("PAD_ERROR", err); delete channels[data.channel]; }, - onConnectionChange: function () {}, + onConnectionChange: function (info) { + if (!info.state) { + channel.bcast("PAD_DISCONNECT"); + } + }, crypto: { // The encryption and decryption is done in the outer window. // This async-store only deals with already encrypted messages. diff --git a/www/common/toolbar3.js b/www/common/toolbar3.js index d6b116df3..c44144fe9 100644 --- a/www/common/toolbar3.js +++ b/www/common/toolbar3.js @@ -574,6 +574,49 @@ MessengerUI, Messages) { return $shareBlock; }; + var createRequest = function (toolbar, config) { + if (!config.metadataMgr) { + throw new Error("You must provide a `metadataMgr` to display the request access button"); + } + + // We can only requets more access if we're in read-only mode + if (config.readOnly !== 1) { return; } + + var $requestBlock = $('