forked from matrix/element-web
Don't mark rooms as unread on m.room.member changes
A quick and hacky fix to issue #169.
This commit is contained in:
parent
714c96283e
commit
c42d4f901b
|
@ -49,6 +49,7 @@
|
||||||
"parallelshell": "^1.2.0",
|
"parallelshell": "^1.2.0",
|
||||||
"rimraf": "^2.4.3",
|
"rimraf": "^2.4.3",
|
||||||
"source-map-loader": "^0.1.5",
|
"source-map-loader": "^0.1.5",
|
||||||
"uglifycss": "0.0.15"
|
"uglifycss": "0.0.15",
|
||||||
|
"webpack": "^1.12.6"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -88,24 +88,33 @@ module.exports = {
|
||||||
onRoomTimeline: function(ev, room, toStartOfTimeline) {
|
onRoomTimeline: function(ev, room, toStartOfTimeline) {
|
||||||
if (toStartOfTimeline) return;
|
if (toStartOfTimeline) return;
|
||||||
|
|
||||||
var newState = this.getRoomLists();
|
var hl = 0;
|
||||||
if (
|
if (
|
||||||
room.roomId != this.props.selectedRoom &&
|
room.roomId != this.props.selectedRoom &&
|
||||||
ev.getSender() != MatrixClientPeg.get().credentials.userId)
|
ev.getSender() != MatrixClientPeg.get().credentials.userId)
|
||||||
{
|
{
|
||||||
var hl = 1;
|
// don't mark rooms as unread for just member changes
|
||||||
|
if (ev.getType() != "m.room.member") {
|
||||||
|
hl = 1;
|
||||||
|
}
|
||||||
|
|
||||||
var actions = MatrixClientPeg.get().getPushActionsForEvent(ev);
|
var actions = MatrixClientPeg.get().getPushActionsForEvent(ev);
|
||||||
if (actions && actions.tweaks && actions.tweaks.highlight) {
|
if (actions && actions.tweaks && actions.tweaks.highlight) {
|
||||||
hl = 2;
|
hl = 2;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (hl > 0) {
|
||||||
|
var newState = this.getRoomLists();
|
||||||
|
|
||||||
// obviously this won't deep copy but this shouldn't be necessary
|
// obviously this won't deep copy but this shouldn't be necessary
|
||||||
var amap = this.state.activityMap;
|
var amap = this.state.activityMap;
|
||||||
amap[room.roomId] = Math.max(amap[room.roomId] || 0, hl);
|
amap[room.roomId] = Math.max(amap[room.roomId] || 0, hl);
|
||||||
|
|
||||||
newState.activityMap = amap;
|
newState.activityMap = amap;
|
||||||
|
|
||||||
|
this.setState(newState);
|
||||||
}
|
}
|
||||||
this.setState(newState);
|
|
||||||
},
|
},
|
||||||
|
|
||||||
onRoomName: function(room) {
|
onRoomName: function(room) {
|
||||||
|
|
Loading…
Reference in New Issue