Use better variable names

This commit is contained in:
Kegan Dougal 2015-09-15 15:02:02 +01:00
parent f384aa7d9e
commit 370310bf82
2 changed files with 7 additions and 8 deletions

View File

@ -99,9 +99,9 @@ module.exports = {
getRoomList: function() { getRoomList: function() {
return RoomListSorter.mostRecentActivityFirst( return RoomListSorter.mostRecentActivityFirst(
MatrixClientPeg.get().getRooms().filter(function(room) { MatrixClientPeg.get().getRooms().filter(function(room) {
var member = room.getMember(MatrixClientPeg.get().credentials.userId); var me = room.getMember(MatrixClientPeg.get().credentials.userId);
var shouldShowRoom = ( var shouldShowRoom = (
member && (member.membership == "join" || member.membership == "invite") me && (me.membership == "join" || me.membership == "invite")
); );
// hiding conf rooms only ever toggles shouldShowRoom to false // hiding conf rooms only ever toggles shouldShowRoom to false
if (shouldShowRoom && HIDE_CONFERENCE_CHANS) { if (shouldShowRoom && HIDE_CONFERENCE_CHANS) {
@ -109,7 +109,7 @@ module.exports = {
var joinedMembers = room.getJoinedMembers(); var joinedMembers = room.getJoinedMembers();
if (joinedMembers.length === 2) { if (joinedMembers.length === 2) {
var otherMember = joinedMembers.filter(function(m) { var otherMember = joinedMembers.filter(function(m) {
return m.userId !== member.userId return m.userId !== me.userId
})[0]; })[0];
if (ConferenceHandler.isConferenceUser(otherMember)) { if (ConferenceHandler.isConferenceUser(otherMember)) {
// console.log("Hiding conference 1:1 room %s", room.roomId); // console.log("Hiding conference 1:1 room %s", room.roomId);

View File

@ -187,22 +187,21 @@ module.exports = {
}, },
_updateConfCallNotification: function() { _updateConfCallNotification: function() {
var member = MatrixClientPeg.get().getRoom(this.props.roomId).getMember( var confMember = MatrixClientPeg.get().getRoom(this.props.roomId).getMember(
ConferenceHandler.getConferenceUserIdForRoom(this.props.roomId) ConferenceHandler.getConferenceUserIdForRoom(this.props.roomId)
); );
if (!member) { if (!confMember) {
return; return;
} }
console.log("_updateConfCallNotification"); var confCall = CallHandler.getConferenceCall(confMember.roomId);
var confCall = CallHandler.getConferenceCall(member.roomId);
// A conf call notification should be displayed if there is an ongoing // A conf call notification should be displayed if there is an ongoing
// conf call but this cilent isn't a part of it. // conf call but this cilent isn't a part of it.
this.setState({ this.setState({
displayConfCallNotification: ( displayConfCallNotification: (
(!confCall || confCall.call_state === "ended") && (!confCall || confCall.call_state === "ended") &&
member.membership === "join" confMember.membership === "join"
) )
}); });
}, },