Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
synapse
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Terraform modules
Monitor
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Timo Ley
synapse
Commits
0271e8e6
Commit
0271e8e6
authored
10 years ago
by
Emmanuel ROHEE
Browse files
Options
Downloads
Patches
Plain Diff
Follow API renaming. state -> presence. mtime_ago -> last_active_ago
parent
74cffcf5
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
webclient/app-filter.js
+1
-1
1 addition, 1 deletion
webclient/app-filter.js
webclient/room/room-controller.js
+12
-13
12 additions, 13 deletions
webclient/room/room-controller.js
webclient/room/room.html
+2
-2
2 additions, 2 deletions
webclient/room/room.html
with
15 additions
and
16 deletions
webclient/app-filter.js
+
1
−
1
View file @
0271e8e6
...
@@ -70,7 +70,7 @@ angular.module('matrixWebClient')
...
@@ -70,7 +70,7 @@ angular.module('matrixWebClient')
});
});
filtered
.
sort
(
function
(
a
,
b
)
{
filtered
.
sort
(
function
(
a
,
b
)
{
return
((
a
[
"
m
ti
m
e_ag
e
"
]
||
10
e10
)
>
(
b
[
"
m
ti
m
e_ag
e
"
]
||
10
e10
)
?
1
:
-
1
);
return
((
a
[
"
last_ac
ti
v
e_ag
o
"
]
||
10
e10
)
>
(
b
[
"
last_ac
ti
v
e_ag
o
"
]
||
10
e10
)
?
1
:
-
1
);
});
});
return
filtered
;
return
filtered
;
};
};
...
...
This diff is collapsed.
Click to expand it.
webclient/room/room-controller.js
+
12
−
13
View file @
0271e8e6
...
@@ -165,11 +165,11 @@ angular.module('RoomController', ['ngSanitize', 'mFileInput'])
...
@@ -165,11 +165,11 @@ angular.module('RoomController', ['ngSanitize', 'mFileInput'])
var
isNewMember
=
!
(
target_user_id
in
$scope
.
members
);
var
isNewMember
=
!
(
target_user_id
in
$scope
.
members
);
if
(
isNewMember
)
{
if
(
isNewMember
)
{
// FIXME: why are we copying these fields around inside chunk?
// FIXME: why are we copying these fields around inside chunk?
if
(
"
stat
e
"
in
chunk
.
content
)
{
if
(
"
presenc
e
"
in
chunk
.
content
)
{
chunk
.
presence
State
=
chunk
.
content
.
state
;
// why is this renamed?
chunk
.
presence
=
chunk
.
content
.
presence
;
}
}
if
(
"
m
ti
m
e_ag
e
"
in
chunk
.
content
)
{
if
(
"
last_ac
ti
v
e_ag
o
"
in
chunk
.
content
)
{
chunk
.
m
ti
m
e_ag
e
=
chunk
.
content
.
m
ti
m
e_ag
e
;
chunk
.
last_ac
ti
v
e_ag
o
=
chunk
.
content
.
last_ac
ti
v
e_ag
o
;
}
}
if
(
"
displayname
"
in
chunk
.
content
)
{
if
(
"
displayname
"
in
chunk
.
content
)
{
chunk
.
displayname
=
chunk
.
content
.
displayname
;
chunk
.
displayname
=
chunk
.
content
.
displayname
;
...
@@ -188,11 +188,11 @@ angular.module('RoomController', ['ngSanitize', 'mFileInput'])
...
@@ -188,11 +188,11 @@ angular.module('RoomController', ['ngSanitize', 'mFileInput'])
// selectively update membership and presence else it will nuke the picture and displayname too :/
// selectively update membership and presence else it will nuke the picture and displayname too :/
var
member
=
$scope
.
members
[
target_user_id
];
var
member
=
$scope
.
members
[
target_user_id
];
member
.
membership
=
chunk
.
content
.
membership
;
member
.
membership
=
chunk
.
content
.
membership
;
if
(
"
stat
e
"
in
chunk
.
content
)
{
if
(
"
presenc
e
"
in
chunk
.
content
)
{
member
.
presence
State
=
chunk
.
content
.
stat
e
;
member
.
presence
=
chunk
.
content
.
presenc
e
;
}
}
if
(
"
m
ti
m
e_ag
e
"
in
chunk
.
content
)
{
if
(
"
last_ac
ti
v
e_ag
o
"
in
chunk
.
content
)
{
member
.
m
ti
m
e_ag
e
=
chunk
.
content
.
m
ti
m
e_ag
e
;
member
.
last_ac
ti
v
e_ag
o
=
chunk
.
content
.
last_ac
ti
v
e_ag
o
;
}
}
}
}
};
};
...
@@ -211,13 +211,12 @@ angular.module('RoomController', ['ngSanitize', 'mFileInput'])
...
@@ -211,13 +211,12 @@ angular.module('RoomController', ['ngSanitize', 'mFileInput'])
var
member
=
$scope
.
members
[
chunk
.
content
.
user_id
];
var
member
=
$scope
.
members
[
chunk
.
content
.
user_id
];
// XXX: why not just pass the chunk straight through?
// XXX: why not just pass the chunk straight through?
if
(
"
stat
e
"
in
chunk
.
content
)
{
if
(
"
presenc
e
"
in
chunk
.
content
)
{
member
.
presence
State
=
chunk
.
content
.
stat
e
;
member
.
presence
=
chunk
.
content
.
presenc
e
;
}
}
if
(
"
mtime_age
"
in
chunk
.
content
)
{
if
(
"
last_active_ago
"
in
chunk
.
content
)
{
// FIXME: should probably keep updating mtime_age in realtime like FB does
member
.
last_active_ago
=
chunk
.
content
.
last_active_ago
;
member
.
mtime_age
=
chunk
.
content
.
mtime_age
;
}
}
// this may also contain a new display name or avatar url, so check.
// this may also contain a new display name or avatar url, so check.
...
...
This diff is collapsed.
Click to expand it.
webclient/room/room.html
+
2
−
2
View file @
0271e8e6
...
@@ -26,8 +26,8 @@
...
@@ -26,8 +26,8 @@
<img
class=
"userAvatarGradient"
src=
"img/gradient.png"
title=
"{{ member.id }}"
width=
"80"
height=
"24"
/>
<img
class=
"userAvatarGradient"
src=
"img/gradient.png"
title=
"{{ member.id }}"
width=
"80"
height=
"24"
/>
<div
class=
"userName"
>
{{ member.displayname || member.id.substr(0, member.id.indexOf(':')) }}
<br/>
{{ member.displayname ? "" : member.id.substr(member.id.indexOf(':')) }}
</div>
<div
class=
"userName"
>
{{ member.displayname || member.id.substr(0, member.id.indexOf(':')) }}
<br/>
{{ member.displayname ? "" : member.id.substr(member.id.indexOf(':')) }}
</div>
</td>
</td>
<td
class=
"userPresence"
ng-class=
"(member.presence
State
=== 'online' ? 'online' : (member.presence
State
=== 'unavailable' ? 'unavailable' : '')) + ' ' + (member.membership == 'invite' ? 'invited' : '')"
>
<td
class=
"userPresence"
ng-class=
"(member.presence === 'online' ? 'online' : (member.presence === 'unavailable' ? 'unavailable' : '')) + ' ' + (member.membership == 'invite' ? 'invited' : '')"
>
<span
ng-show=
"member.
m
ti
m
e_ag
e
"
>
{{ member.
m
ti
m
e_ag
e
+ (now - member.last_updated) | duration }}
<br/>
ago
</span>
<span
ng-show=
"member.
last_ac
ti
v
e_ag
o
"
>
{{ member.
last_ac
ti
v
e_ag
o
+ (now - member.last_updated) | duration }}
<br/>
ago
</span>
</td>
</td>
</table>
</table>
</div>
</div>
...
...
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