From 275fe802865e1171d4704c59bb664e8ef5623b2f Mon Sep 17 00:00:00 2001 From: LittleSheep Date: Sun, 24 Nov 2024 22:24:49 +0800 Subject: [PATCH] :bug: Fix new call panics --- pkg/internal/models/channels.go | 2 +- pkg/internal/services/calls.go | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/pkg/internal/models/channels.go b/pkg/internal/models/channels.go index 2c66d00..7577937 100644 --- a/pkg/internal/models/channels.go +++ b/pkg/internal/models/channels.go @@ -35,7 +35,7 @@ func (v Channel) DisplayText() string { if v.Type == ChannelTypeDirect { return "DM" } - if v.RealmID != nil { + if v.Realm != nil { return fmt.Sprintf("%s, %s", v.Alias, v.Realm.Alias) } return fmt.Sprintf("%s", v.Alias) diff --git a/pkg/internal/services/calls.go b/pkg/internal/services/calls.go index c1c2e81..70eb97b 100644 --- a/pkg/internal/services/calls.go +++ b/pkg/internal/services/calls.go @@ -130,6 +130,13 @@ func NewCall(channel models.Channel, founder models.ChannelMember) (models.Call, } } + if channel.RealmID != nil { + realm, err := authkit.GetRealm(gap.Nx, *channel.RealmID) + if err == nil { + channel.Realm = &realm + } + } + err = authkit.NotifyUserBatch( gap.Nx, pendingUsers,