Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
N
Nakama
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
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
public-projects
Nakama
Commits
9843a76f
Commit
9843a76f
authored
5 years ago
by
Andrei Mihu
Browse files
Options
Downloads
Patches
Plain Diff
Populate room, group, and direct message fields in channel presence events.
parent
1a087f9b
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
CHANGELOG.md
+1
-0
1 addition, 0 deletions
CHANGELOG.md
server/tracker.go
+53
-5
53 additions, 5 deletions
server/tracker.go
with
54 additions
and
5 deletions
CHANGELOG.md
+
1
−
0
View file @
9843a76f
...
...
@@ -14,6 +14,7 @@ The format is based on [keep a changelog](http://keepachangelog.com) and this pr
### Fixed
-
Ensure runtime environment values do not appear multiple times in the devconsole configuration view.
-
Channel presence events now populate room, group, and direct message fields.
## [2.11.1] - 2020-03-29
### Changed
...
...
This diff is collapsed.
Click to expand it.
server/tracker.go
+
53
−
5
View file @
9843a76f
...
...
@@ -778,9 +778,31 @@ func (t *LocalTracker) processEvent(e *PresenceEvent) {
Leaves
:
leaves
,
}}}
case
StreamModeChannel
:
fallthrough
channelID
,
err
:=
StreamToChannelId
(
stream
)
if
err
!=
nil
{
// Should not happen thanks to previous validation, but guard just in case.
t
.
logger
.
Error
(
"Error converting stream to channel identifier in presence event"
,
zap
.
Error
(
err
),
zap
.
Any
(
"stream"
,
stream
))
continue
}
envelope
=
&
rtapi
.
Envelope
{
Message
:
&
rtapi
.
Envelope_ChannelPresenceEvent
{
ChannelPresenceEvent
:
&
rtapi
.
ChannelPresenceEvent
{
ChannelId
:
channelID
,
Joins
:
joins
,
Leaves
:
leaves
,
RoomName
:
streamWire
.
Label
,
}}}
case
StreamModeGroup
:
fallthrough
channelID
,
err
:=
StreamToChannelId
(
stream
)
if
err
!=
nil
{
// Should not happen thanks to previous validation, but guard just in case.
t
.
logger
.
Error
(
"Error converting stream to channel identifier in presence event"
,
zap
.
Error
(
err
),
zap
.
Any
(
"stream"
,
stream
))
continue
}
envelope
=
&
rtapi
.
Envelope
{
Message
:
&
rtapi
.
Envelope_ChannelPresenceEvent
{
ChannelPresenceEvent
:
&
rtapi
.
ChannelPresenceEvent
{
ChannelId
:
channelID
,
Joins
:
joins
,
Leaves
:
leaves
,
GroupId
:
streamWire
.
Subject
,
}}}
case
StreamModeDM
:
channelID
,
err
:=
StreamToChannelId
(
stream
)
if
err
!=
nil
{
...
...
@@ -792,6 +814,8 @@ func (t *LocalTracker) processEvent(e *PresenceEvent) {
ChannelId
:
channelID
,
Joins
:
joins
,
Leaves
:
leaves
,
UserIdOne
:
streamWire
.
Subject
,
UserIdTwo
:
streamWire
.
Subcontext
,
}}}
case
StreamModeMatchRelayed
:
fallthrough
...
...
@@ -883,9 +907,31 @@ func (t *LocalTracker) processEvent(e *PresenceEvent) {
Leaves
:
leaves
,
}}}
case
StreamModeChannel
:
fallthrough
channelID
,
err
:=
StreamToChannelId
(
stream
)
if
err
!=
nil
{
// Should not happen thanks to previous validation, but guard just in case.
t
.
logger
.
Error
(
"Error converting stream to channel identifier in presence event"
,
zap
.
Error
(
err
),
zap
.
Any
(
"stream"
,
stream
))
continue
}
envelope
=
&
rtapi
.
Envelope
{
Message
:
&
rtapi
.
Envelope_ChannelPresenceEvent
{
ChannelPresenceEvent
:
&
rtapi
.
ChannelPresenceEvent
{
ChannelId
:
channelID
,
// No joins.
Leaves
:
leaves
,
RoomName
:
streamWire
.
Label
,
}}}
case
StreamModeGroup
:
fallthrough
channelID
,
err
:=
StreamToChannelId
(
stream
)
if
err
!=
nil
{
// Should not happen thanks to previous validation, but guard just in case.
t
.
logger
.
Error
(
"Error converting stream to channel identifier in presence event"
,
zap
.
Error
(
err
),
zap
.
Any
(
"stream"
,
stream
))
continue
}
envelope
=
&
rtapi
.
Envelope
{
Message
:
&
rtapi
.
Envelope_ChannelPresenceEvent
{
ChannelPresenceEvent
:
&
rtapi
.
ChannelPresenceEvent
{
ChannelId
:
channelID
,
// No joins.
Leaves
:
leaves
,
GroupId
:
streamWire
.
Subject
,
}}}
case
StreamModeDM
:
channelID
,
err
:=
StreamToChannelId
(
stream
)
if
err
!=
nil
{
...
...
@@ -897,6 +943,8 @@ func (t *LocalTracker) processEvent(e *PresenceEvent) {
ChannelId
:
channelID
,
// No joins.
Leaves
:
leaves
,
UserIdOne
:
streamWire
.
Subject
,
UserIdTwo
:
streamWire
.
Subcontext
,
}}}
case
StreamModeMatchRelayed
:
fallthrough
...
...
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