don't let guests invite

This commit is contained in:
Matthew Hodgson 2016-09-17 02:05:01 +01:00
parent 48fb578952
commit 91dd029483
1 changed files with 10 additions and 0 deletions

View File

@ -22,6 +22,7 @@ var Matrix = require("matrix-js-sdk");
var dis = require('matrix-react-sdk/lib/dispatcher'); var dis = require('matrix-react-sdk/lib/dispatcher');
var MatrixClientPeg = require("matrix-react-sdk/lib/MatrixClientPeg"); var MatrixClientPeg = require("matrix-react-sdk/lib/MatrixClientPeg");
var rate_limited_func = require('matrix-react-sdk/lib/ratelimitedfunc'); var rate_limited_func = require('matrix-react-sdk/lib/ratelimitedfunc');
var Modal = require('matrix-react-sdk/lib/Modal');
module.exports = React.createClass({ module.exports = React.createClass({
displayName: 'RightPanel', displayName: 'RightPanel',
@ -110,6 +111,15 @@ module.exports = React.createClass({
}, },
onInviteButtonClick: function() { onInviteButtonClick: function() {
if (MatrixClientPeg.get().isGuest()) {
var NeedToRegisterDialog = sdk.getComponent("dialogs.NeedToRegisterDialog");
Modal.createDialog(NeedToRegisterDialog, {
title: "Please Register",
description: "Guest users can't invite users. Please register to invite."
});
return;
}
// call ChatInviteDialog // call ChatInviteDialog
dis.dispatch({ dis.dispatch({
action: 'view_invite', action: 'view_invite',