Skip to content

Commit

Permalink
store ex_user_id info in analytics too
Browse files Browse the repository at this point in the history
  • Loading branch information
jibon57 committed Sep 14, 2024
1 parent 3f0066f commit 158b94b
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 9 deletions.
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ require (
github.com/jordic/lti v0.0.0-20160211051708-2c756eacbab9
github.com/livekit/protocol v1.21.0
github.com/livekit/server-sdk-go/v2 v2.2.1
github.com/mynaparrot/plugnmeet-protocol v0.0.0-20240914091133-c7e7013cf2f6
github.com/mynaparrot/plugnmeet-protocol v0.0.0-20240914113712-e6e9efae7d51
github.com/nats-io/jwt/v2 v2.6.0
github.com/nats-io/nats.go v1.37.0
github.com/nats-io/nkeys v0.4.7
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -128,8 +128,8 @@ github.com/mattn/go-isatty v0.0.20 h1:xfD0iDuEKnDkl03q4limB+vH+GxLEtL/jb4xVJSWWE
github.com/mattn/go-isatty v0.0.20/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y=
github.com/mattn/go-runewidth v0.0.16 h1:E5ScNMtiwvlvB5paMFdw9p4kSQzbXFikJ5SQO6TULQc=
github.com/mattn/go-runewidth v0.0.16/go.mod h1:Jdepj2loyihRzMpdS35Xk/zdY8IAYHsh153qUoGf23w=
github.com/mynaparrot/plugnmeet-protocol v0.0.0-20240914091133-c7e7013cf2f6 h1:RcgyudWXSCPIcyQAHLEH9rqxLGMENPeWXN8KK4OKsbU=
github.com/mynaparrot/plugnmeet-protocol v0.0.0-20240914091133-c7e7013cf2f6/go.mod h1:oXYXVoAr5AQAO785GGRZdaF2Pn1t8PZsjoIs3cGcSJY=
github.com/mynaparrot/plugnmeet-protocol v0.0.0-20240914113712-e6e9efae7d51 h1:M/3/IyT3ps5OoO+c8GlnVDsvuBQJ5jWMvK6blA5kOdY=
github.com/mynaparrot/plugnmeet-protocol v0.0.0-20240914113712-e6e9efae7d51/go.mod h1:oXYXVoAr5AQAO785GGRZdaF2Pn1t8PZsjoIs3cGcSJY=
github.com/nats-io/jwt/v2 v2.6.0 h1:yXoBTdEotZw3NujMT+Nnu1UPNlFWdKQ3d0JJF/+pJag=
github.com/nats-io/jwt/v2 v2.6.0/go.mod h1:ZdWS1nZa6WMZfFwwgpEaqBV8EPGVgOTDHN/wTbz0Y5A=
github.com/nats-io/nats.go v1.37.0 h1:07rauXbVnnJvv1gfIyghFEo6lUcYRY0WXc3x7x0vUxE=
Expand Down
9 changes: 5 additions & 4 deletions pkg/models/analytics_export.go
Original file line number Diff line number Diff line change
Expand Up @@ -143,10 +143,11 @@ func (m *AnalyticsModel) exportAnalyticsToFile(room *dbmodels.RoomInfo, path str
uf := new(plugnmeet.AnalyticsRedisUserInfo)
_ = protojson.Unmarshal([]byte(n), uf)
userInfo := &plugnmeet.AnalyticsUserInfo{
UserId: i,
Name: *uf.Name,
IsAdmin: uf.IsAdmin,
Events: []*plugnmeet.AnalyticsEventData{},
UserId: i,
Name: *uf.Name,
IsAdmin: uf.IsAdmin,
ExUserId: uf.ExUserId,
Events: []*plugnmeet.AnalyticsEventData{},
}

for _, ev := range userRedisKeys {
Expand Down
6 changes: 4 additions & 2 deletions pkg/models/analytics_insert.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,11 @@ func (m *AnalyticsModel) handleFirstTimeUserJoined(key string) {
}

uInfo := &plugnmeet.AnalyticsRedisUserInfo{
Name: m.data.UserName,
IsAdmin: umeta.IsAdmin,
Name: m.data.UserName,
IsAdmin: umeta.IsAdmin,
ExUserId: umeta.ExUserId,
}

op := protojson.MarshalOptions{
EmitUnpopulated: true,
UseProtoNames: true,
Expand Down

0 comments on commit 158b94b

Please sign in to comment.