forked from matrix/element-web
there is no content.target - it's state_key. Also, warn if no target
This commit is contained in:
parent
1df8e65cdf
commit
a730804943
|
@ -2,7 +2,7 @@
|
||||||
function textForMemberEvent(ev) {
|
function textForMemberEvent(ev) {
|
||||||
// XXX: SYJS-16
|
// XXX: SYJS-16
|
||||||
var senderName = ev.sender ? ev.sender.name : ev.getSender();
|
var senderName = ev.sender ? ev.sender.name : ev.getSender();
|
||||||
var targetName = ev.target ? ev.target.name : ev.getContent().target;
|
var targetName = ev.target ? ev.target.name : ev.getContent().state_key;
|
||||||
var reason = ev.getContent().reason ? (
|
var reason = ev.getContent().reason ? (
|
||||||
" Reason: " + ev.getContent().reason
|
" Reason: " + ev.getContent().reason
|
||||||
) : "";
|
) : "";
|
||||||
|
@ -23,6 +23,7 @@ function textForMemberEvent(ev) {
|
||||||
return ev.getSender() + " removed their display name";
|
return ev.getSender() + " removed their display name";
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
if (!ev.target) console.warn("Join message has no target! -- " + ev.getContent().state_key);
|
||||||
return targetName + " joined the room.";
|
return targetName + " joined the room.";
|
||||||
}
|
}
|
||||||
case 'leave':
|
case 'leave':
|
||||||
|
|
Loading…
Reference in New Issue