Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Matrix
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Container Registry
Model registry
Operate
Environments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
TeDomum
Matrix
Commits
e8e80fe6
Commit
e8e80fe6
authored
10 years ago
by
Matthew Hodgson
Browse files
Options
Downloads
Patches
Plain Diff
fix yet more room id leak disasters
parent
0e848d73
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
webclient/components/matrix/matrix-filter.js
+12
-5
12 additions, 5 deletions
webclient/components/matrix/matrix-filter.js
with
12 additions
and
5 deletions
webclient/components/matrix/matrix-filter.js
+
12
−
5
View file @
e8e80fe6
...
...
@@ -51,6 +51,7 @@ angular.module('matrixFilter', [])
if
(
member
.
state_key
in
$rootScope
.
presence
)
{
// If the user is listed in presence, use the displayname there
// as it is the most uptodate
// XXX: is this true nowadays?
roomName
=
$rootScope
.
presence
[
member
.
state_key
].
content
.
displayname
||
member
.
state_key
;
}
else
{
...
...
@@ -59,13 +60,19 @@ angular.module('matrixFilter', [])
}
}
}
else
if
(
1
===
Object
.
keys
(
room
.
members
).
length
)
{
else
if
(
Object
.
keys
(
room
.
members
).
length
<=
1
)
{
var
otherUserId
;
if
(
Object
.
keys
(
room
.
members
)[
0
]
!==
user_id
)
{
if
(
Object
.
keys
(
room
.
members
)[
0
]
&&
Object
.
keys
(
room
.
members
)[
0
]
!==
user_id
)
{
otherUserId
=
Object
.
keys
(
room
.
members
)[
0
];
}
else
{
// it's got to be an invite, or failing that a self-chat;
otherUserId
=
room
.
inviter
||
user_id
;
/*
// XXX: This should all be unnecessary now thanks to using the /rooms/<room>/roomid API
// The other member may be in the invite list, get all invited users
var invitedUserIDs = [];
...
...
@@ -92,13 +99,13 @@ angular.module('matrixFilter', [])
if (1 === invitedUserIDs.length) {
otherUserId = invitedUserIDs[0];
}
*/
}
if
(
!
otherUserId
)
otherUserId
=
user_id
;
// name the room after ourselves as we're the only person there!
// Try to resolve his displayname in presence global data
// XXX: should we be looking in the room state instead, given it should be accurate nowadays?
if
(
otherUserId
in
$rootScope
.
presence
)
{
roomName
=
$rootScope
.
presence
[
otherUserId
].
content
.
displayname
;
roomName
=
$rootScope
.
presence
[
otherUserId
].
content
.
displayname
||
otherUserId
;
}
else
{
roomName
=
otherUserId
;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment