pass event in the Room.tags event

This commit is contained in:
Matthew Hodgson
2015-11-07 20:23:09 +00:00
parent 170a78a420
commit 53bbabea4f
+4 -3
View File
@@ -473,7 +473,7 @@ Room.prototype.addTags = function(event) {
// XXX: we could do a deep-comparison to see if the tags have really
// changed - but do we want to bother?
this.emit("Room.tags", this);
this.emit("Room.tags", event, this);
};
function setEventMetadata(event, stateContext, toStartOfTimeline) {
@@ -618,10 +618,11 @@ module.exports = Room;
/**
* Fires whenever a room's tags are updated.
* @event module:client~MatrixClient#"Room.tags"
* @param {event} event The tags event
* @param {Room} room The room whose Room.tags was updated.
* @example
* matrixClient.on("Room.tags", function(room){
* var newTags = room.tags;
* matrixClient.on("Room.tags", function(event, room){
* var newTags = event.getContent().tags;
* if (newTags["favourite"]) showStar(room);
* });
*/