stop guests from setting avatars

pull/21833/head
Matthew Hodgson 2016-03-15 23:55:59 +00:00
parent 0e1186c4f9
commit 25bf4030de
1 changed files with 9 additions and 0 deletions

View File

@ -90,6 +90,15 @@ module.exports = React.createClass({
},
onAvatarPickerClick: function(ev) {
if (MatrixClientPeg.get().isGuest()) {
var ErrorDialog = sdk.getComponent("dialogs.ErrorDialog");
Modal.createDialog(ErrorDialog, {
title: "Error",
description: "Guests can't set avatars. Please register.",
});
return;
}
if (this.refs.file_label) {
this.refs.file_label.click();
}