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() {
return RoomListSorter.mostRecentActivityFirst(
MatrixClientPeg.get().getRooms().filter(function(room) {
var member = room.getMember(MatrixClientPeg.get().credentials.userId);
var me = room.getMember(MatrixClientPeg.get().credentials.userId);
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
if (shouldShowRoom && HIDE_CONFERENCE_CHANS) {
@ -109,7 +109,7 @@ module.exports = {
var joinedMembers = room.getJoinedMembers();
if (joinedMembers.length === 2) {
var otherMember = joinedMembers.filter(function(m) {
return m.userId !== member.userId
return m.userId !== me.userId
})[0];
if (ConferenceHandler.isConferenceUser(otherMember)) {
// console.log("Hiding conference 1:1 room %s", room.roomId);

View file

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