rethink needed

This commit is contained in:
2026-04-26 21:56:00 +02:00
parent 472b4ea703
commit ca084a21fa
3 changed files with 33 additions and 23 deletions
+7 -2
View File
@@ -206,6 +206,8 @@ const (
CachedUserCanMessage
)
const CachedUserPermissionsAll = CachedUserCanMessage | CachedUserCanReadHistory | CachedUserCanReadHistory
func (p *CachedUserPermissions) SetCanView() { *p |= CachedUserCanView }
func (p *CachedUserPermissions) ClearCanView() { *p &^= CachedUserCanView }
func (p CachedUserPermissions) CanView() bool { return p&CachedUserCanView != 0 }
@@ -284,7 +286,9 @@ type HubGroup struct {
}
func NewHubGroup() *HubGroup {
return &HubGroup{}
return &HubGroup{
UsersCachedPermissions: make(map[uuid.UUID]CachedUserPermissions),
}
}
type HubChannel struct {
@@ -307,7 +311,8 @@ type HubChannel struct {
func NewHubChannel() *HubChannel {
return &HubChannel{
MessagesBuff: make([]*Message, config.MaxHubChannelMsgCache),
MessagesBuff: make([]*Message, config.MaxHubChannelMsgCache),
UsersCachedPermissions: make(map[uuid.UUID]CachedUserPermissions),
}
}
func (conn *HubChannel) AddMessageToBuff(message *Message) {