diff --git a/src/controllers/organisms/RoomList.js b/src/controllers/organisms/RoomList.js
index c715faad..03a1bfcd 100644
--- a/src/controllers/organisms/RoomList.js
+++ b/src/controllers/organisms/RoomList.js
@@ -33,6 +33,7 @@ module.exports = {
cli.on("Room", this.onRoom);
cli.on("Room.timeline", this.onRoomTimeline);
cli.on("Room.name", this.onRoomName);
+ cli.on("RoomState.events", this.onRoomStateEvents);
var rooms = this.getRoomList();
this.setState({
@@ -66,6 +67,7 @@ module.exports = {
MatrixClientPeg.get().removeListener("Room", this.onRoom);
MatrixClientPeg.get().removeListener("Room.timeline", this.onRoomTimeline);
MatrixClientPeg.get().removeListener("Room.name", this.onRoomName);
+ MatrixClientPeg.get().removeListener("RoomState.events", this.onRoomStateEvents);
}
},
@@ -110,6 +112,11 @@ module.exports = {
this.refreshRoomList();
},
+ onRoomStateEvents: function(ev, state) {
+ setTimeout(this.refreshRoomList, 0);
+ },
+
+
refreshRoomList: function() {
var rooms = this.getRoomList();
this.setState({
diff --git a/src/skins/vector/views/atoms/RoomAvatar.js b/src/skins/vector/views/atoms/RoomAvatar.js
index 4416a6b8..161b1eb1 100644
--- a/src/skins/vector/views/atoms/RoomAvatar.js
+++ b/src/skins/vector/views/atoms/RoomAvatar.js
@@ -43,9 +43,13 @@ module.exports = React.createClass({
},
render: function() {
+ var style = {
+ maxWidth: this.props.width,
+ maxHeight: this.props.height,
+ };
return (
);
}
diff --git a/src/skins/vector/views/molecules/ChangeAvatar.js b/src/skins/vector/views/molecules/ChangeAvatar.js
index 52a59e3f..42c2d1fd 100644
--- a/src/skins/vector/views/molecules/ChangeAvatar.js
+++ b/src/skins/vector/views/molecules/ChangeAvatar.js
@@ -18,6 +18,7 @@ limitations under the License.
var React = require('react');
+var sdk = require('matrix-react-sdk')
var ChangeAvatarController = require('matrix-react-sdk/lib/controllers/molecules/ChangeAvatar')
var Loader = require("react-loader");
@@ -28,6 +29,7 @@ module.exports = React.createClass({
mixins: [ChangeAvatarController],
onFileSelected: function(ev) {
+ this.avatarSet = true;
this.setAvatarFromFile(ev.target.files[0]);
},
@@ -38,13 +40,27 @@ module.exports = React.createClass({
},
render: function() {
+ var RoomAvatar = sdk.getComponent('atoms.RoomAvatar');
+ var avatarImg;
+ // Having just set an avatar we just display that since it will take a little
+ // time to propagate through to the RoomAvatar.
+ if (this.props.room && !this.avatarSet) {
+ avatarImg =