🐛 Fix new call panics

This commit is contained in:
LittleSheep 2024-11-24 22:24:49 +08:00
parent a75144d0db
commit 275fe80286
2 changed files with 8 additions and 1 deletions

View File

@ -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)

View File

@ -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,