mirror of
https://git.anonymousland.org/anonymousland/synapse-product.git
synced 2024-10-01 08:25:44 -04:00
Fix SYWEB-110 : Prevent room ID leaking by looking for an m.room.name
This commit is contained in:
parent
4841b6d4ba
commit
4f6acf114c
@ -221,9 +221,19 @@ function(matrixService, $rootScope, $q, $timeout, mPresence) {
|
|||||||
message = "* " + displayname + " " + message;
|
message = "* " + displayname + " " + message;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var roomTitle = matrixService.getRoomIdToAliasMapping(event.room_id);
|
||||||
|
var theRoom = $rootScope.events.rooms[event.room_id];
|
||||||
|
if (!roomTitle && theRoom && theRoom["m.room.name"] && theRoom["m.room.name"].content) {
|
||||||
|
roomTitle = theRoom["m.room.name"].content.name;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!roomTitle) {
|
||||||
|
roomTitle = event.room_id;
|
||||||
|
}
|
||||||
|
|
||||||
var notification = new window.Notification(
|
var notification = new window.Notification(
|
||||||
displayname +
|
displayname +
|
||||||
" (" + (matrixService.getRoomIdToAliasMapping(event.room_id) || event.room_id) + ")", // FIXME: don't leak room_ids here
|
" (" + roomTitle + ")",
|
||||||
{
|
{
|
||||||
"body": message,
|
"body": message,
|
||||||
"icon": member ? member.avatar_url : undefined
|
"icon": member ? member.avatar_url : undefined
|
||||||
|
Loading…
Reference in New Issue
Block a user