Skip to content
Next
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Switch to GitLab Next
Sign in / Register
Toggle navigation
Minds Frontend
Project
Project
Details
Activity
Releases
Dependency List
Cycle Analytics
Insights
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Locked Files
Issues
813
Issues
813
List
Boards
Labels
Service Desk
Milestones
Merge Requests
49
Merge Requests
49
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
List
Container Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Minds
Minds Frontend
Commits
2ea0c888
Commit
2ea0c888
authored
10 hours ago
by
Guy Thouret
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
(feat) Pulse the avatar of users in groups who are participants of the gathering - Related to
#1515
parent
6d54b4a5
feat/1515-pulse-avatar
1 merge request
!457
(feat) Pulse the avatar of users in groups who are participants of the gathering
Pipeline
#71808708
passed with stages
in 30 minutes and 52 seconds
Changes
4
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
78 additions
and
20 deletions
+78
-20
update-markers.service.ts
src/app/common/services/update-markers.service.ts
+14
-11
member-previews.component.html
...ps/profile/member-previews/member-previews.component.html
+1
-1
member-previews.component.ts
...oups/profile/member-previews/member-previews.component.ts
+61
-5
videochat.service.ts
src/app/modules/videochat/videochat.service.ts
+2
-3
No files found.
src/app/common/services/update-markers.service.ts
View file @
2ea0c888
...
...
@@ -89,8 +89,10 @@ export class UpdateMarkersService {
if
(
!
opts
.
marker
)
throw
"
marker must be set
"
;
this
.
http
.
post
(
'
api/v2/notifications/markers/read
'
,
opts
)
.
subscribe
(
res
=>
null
,
err
=>
console
.
warn
(
err
));
if
(
!
opts
.
noReply
)
{
this
.
http
.
post
(
'
api/v2/notifications/markers/read
'
,
opts
)
.
subscribe
(
res
=>
null
,
err
=>
console
.
warn
(
err
));
}
for
(
let
i
=
0
;
i
<
this
.
data
.
length
;
i
++
)
{
if
(
this
.
data
[
i
].
entity_guid
==
opts
.
entity_guid
)
{
...
...
@@ -127,15 +129,16 @@ export class UpdateMarkersService {
(
marker
)
=>
{
marker
=
JSON
.
parse
(
marker
);
let
entity_guid
=
marker
.
entity_guid
;
if
(
this
.
muted
.
indexOf
(
entity_guid
)
>
-
1
)
return
;
//muted, so take no action
//this.entityGuids$[entity_guid].next(marker);
let
found
:
boolean
=
false
;
for
(
let
i
in
this
.
data
)
{
if
(
this
.
data
[
i
].
entity_guid
===
entity_guid
&&
this
.
data
[
i
].
marker
===
marker
.
marker
)
{
if
(
this
.
muted
.
indexOf
(
entity_guid
)
>
-
1
)
{
return
;
}
let
found
=
false
;
for
(
let
i
in
this
.
data
)
{
if
(
this
.
data
[
i
].
entity_guid
===
entity_guid
&&
this
.
data
[
i
].
marker
===
marker
.
marker
&&
this
.
data
[
i
].
user_guid
===
marker
.
user_guid
)
{
this
.
data
[
i
].
updated_timestamp
=
marker
.
updated_timestamp
;
found
=
true
;
}
...
...
This diff is collapsed.
Click to expand it.
src/app/modules/groups/profile/member-previews/member-previews.component.html
View file @
2ea0c888
<ul
class=
"m-groupMemberPreviews__list"
>
<li
class=
"m-groupMemberPreviews__member"
*
ngFor=
"let member of members"
>
<li
class=
"m-groupMemberPreviews__member"
[
ngClass
]="{'
m-pulsating--small
'
:
member
.
inGathering
}"
*
ngFor=
"let member of members"
>
<a
[
routerLink
]="['/',
member
.
username
]"
>
<img
[
src
]="
minds
.
cdn_url
+
'
icon
/'
+
member
.
guid
+
'/
small
'"
/>
</a>
...
...
This diff is collapsed.
Click to expand it.
src/app/modules/groups/profile/member-previews/member-previews.component.ts
View file @
2ea0c888
import
{
Component
,
ViewChild
,
ChangeDetectorRef
,
Input
}
from
'
@angular/core
'
;
import
{
ActivatedRoute
}
from
'
@angular/router
'
;
import
{
Subscription
}
from
'
rxjs
'
;
import
{
Client
}
from
'
../../../../services/api
'
;
import
{
UpdateMarkersService
}
from
'
../../../../common/services/update-markers.service
'
;
import
{
VideoChatService
}
from
'
../../../videochat/videochat.service
'
;
import
{
timer
,
Subscription
}
from
'
rxjs
'
;
@
Component
({
selector
:
'
m-group--member-previews
'
,
...
...
@@ -13,18 +15,35 @@ export class GroupMemberPreviews {
@
Input
()
group
;
members
:
Array
<
any
>
=
[];
count
:
Number
=
0
;
count
:
Number
=
0
;
inProgress
:
boolean
=
false
;
minds
=
window
.
Minds
;
gatheringParticipantTimer
;
constructor
(
private
client
:
Client
)
{
private
updateMarkersSubscription
:
Subscription
;
private
gatheringParticipantUpdateSubscription
:
Subscription
;
}
constructor
(
private
client
:
Client
,
private
updateMarkers
:
UpdateMarkersService
)
{
}
ngOnInit
()
{
const
checkIntervalSeconds
=
2
;
this
.
gatheringParticipantTimer
=
timer
(
0
,
checkIntervalSeconds
*
1000
);
this
.
load
();
}
ngOnDestroy
()
{
if
(
this
.
updateMarkersSubscription
)
{
this
.
updateMarkersSubscription
.
unsubscribe
();
}
if
(
this
.
gatheringParticipantUpdateSubscription
)
{
this
.
gatheringParticipantUpdateSubscription
.
unsubscribe
();
}
}
async
load
()
{
this
.
inProgress
=
true
;
...
...
@@ -42,8 +61,45 @@ export class GroupMemberPreviews {
}
this
.
inProgress
=
false
;
}
catch
{
this
.
inProgress
=
false
;
this
.
inProgress
=
false
;
}
this
.
updateMarkersSubscription
=
this
.
updateMarkers
.
getByEntityGuid
(
this
.
group
.
guid
).
subscribe
((
marker
=>
{
if
(
!
marker
)
{
return
;
}
if
(
marker
.
entity_guid
===
this
.
group
.
guid
&&
marker
.
marker
===
'
gathering-heartbeat
'
&&
marker
.
updated_timestamp
>
this
.
currentTimestamp
()
-
30
)
{
this
.
userIsInGathering
(
marker
.
user_guid
);
}
}).
bind
(
this
));
this
.
gatheringParticipantUpdateSubscription
=
this
.
gatheringParticipantTimer
.
subscribe
(()
=>
this
.
updateGatheringParticipants
());
}
userIsInGathering
(
user_guid
)
{
for
(
let
member
of
this
.
members
)
{
if
(
member
.
guid
===
user_guid
)
{
member
.
inGathering
=
true
;
member
.
lastGatheringMarkerTimestamp
=
this
.
currentTimestamp
();
}
}
}
updateGatheringParticipants
()
{
const
timestampThreshold
=
this
.
currentTimestamp
()
-
(
2
*
VideoChatService
.
heartBeatIntervalSeconds
);
for
(
let
member
of
this
.
members
)
{
if
(
member
.
inGathering
)
{
if
(
member
.
lastGatheringMarkerTimestamp
<
timestampThreshold
)
{
member
.
inGathering
=
false
;
}
}
}
}
currentTimestamp
()
{
return
Date
.
now
()
/
1000
;
}
}
This diff is collapsed.
Click to expand it.
src/app/modules/videochat/videochat.service.ts
View file @
2ea0c888
...
...
@@ -11,13 +11,12 @@ export type JitsiConfig = {
@
Injectable
()
export
class
VideoChatService
{
static
heartBeatIntervalSeconds
=
5
;
isActive
:
boolean
;
activate
$
:
EventEmitter
<
JitsiConfig
|
false
>
=
new
EventEmitter
<
JitsiConfig
|
false
>
();
heartBeatSubscription
;
keepAliveInterval
;
constructor
(
private
client
:
Client
,
private
session
:
Session
...
...
@@ -41,7 +40,7 @@ export class VideoChatService {
if
(
this
.
heartBeatSubscription
)
this
.
heartBeatSubscription
.
unsubscribe
();
this
.
heartBeatSubscription
=
interval
(
10000
)
//10 seconds
this
.
heartBeatSubscription
=
interval
(
VideoChatService
.
heartBeatIntervalSeconds
*
1000
)
.
pipe
(
startWith
(
0
))
.
subscribe
(()
=>
this
.
heartBeat
(
entity
.
guid
));
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment