add message in hub

This commit is contained in:
2026-04-28 20:17:37 +02:00
parent 79219971d0
commit a49f9f4615
18 changed files with 2125 additions and 51 deletions
+16 -14
View File
@@ -228,24 +228,26 @@ func (p *CachedUserPermissions) ClearCanMessage() { *p &^= CachedUserCanMessage
func (p CachedUserPermissions) CanMessage() bool { return p&CachedUserCanMessage != 0 }
type Hub struct {
Mu sync.RWMutex `json:"-"`
CreatedAt time.Time `json:"createdAt"`
Roles [256]*HubRole `json:"-"`
Users map[uuid.UUID]*HubUser `json:"-"`
Groups [256]*HubGroup `json:"-"`
Name string `json:"name"`
IconUrl string `json:"iconUrl"`
BgUrl string `json:"backgroundUrl"`
JoinRole *HubRole `json:"joinRole"`
Id uuid.UUID `json:"id"`
Creator uuid.UUID `json:"creator"`
Color Rgba `json:"color"`
UserColorAllowed bool `json:"userColorAllowed"`
Mu sync.RWMutex `json:"-"`
CreatedAt time.Time `json:"createdAt"`
Roles [256]*HubRole `json:"-"`
Users map[uuid.UUID]*HubUser `json:"-"`
Groups [256]*HubGroup `json:"-"`
Channels map[uuid.UUID]*HubChannel `json:"channels"`
Name string `json:"name"`
IconUrl string `json:"iconUrl"`
BgUrl string `json:"backgroundUrl"`
JoinRole *HubRole `json:"joinRole"`
Id uuid.UUID `json:"id"`
Creator uuid.UUID `json:"creator"`
Color Rgba `json:"color"`
UserColorAllowed bool `json:"userColorAllowed"`
}
func NewHub() *Hub {
return &Hub{
Users: make(map[uuid.UUID]*HubUser),
Users: make(map[uuid.UUID]*HubUser),
Channels: make(map[uuid.UUID]*HubChannel),
}
}