add new event types

This commit is contained in:
2026-04-28 16:38:16 +02:00
parent 00eddfb53e
commit 79219971d0
10 changed files with 137 additions and 67 deletions
+19 -12
View File
@@ -26,18 +26,18 @@ func (r Rgba) GetRandom() Rgba {
}
type User struct {
Mu sync.RWMutex `json:"-"`
Name string `json:"name"`
Pronouns string `json:"pronouns"`
Description string `json:"description"`
AvatarUrl string `json:"avatarUrl"`
ProfileBgUrl string `json:"profileBackgroundUrl"`
PasswordHash string `json:"-"`
CreatedAt time.Time `json:"createdAt"`
WsConn *websocket.Conn `json:"-"`
Id uuid.UUID `json:"-"`
Connections map[uuid.UUID]*Connection `json:"-"`
Color Rgba `json:"color"`
Mu sync.RWMutex `json:"-"`
Name string `json:"name"`
Pronouns string `json:"pronouns"`
Description string `json:"description"`
AvatarType string `json:"avatarType"`
ProfileBgType string `json:"profileBackgroundType"`
PasswordHash string `json:"-"`
CreatedAt time.Time `json:"createdAt"`
WsConn *websocket.Conn `json:"-"`
Id uuid.UUID `json:"-"`
Connections map[uuid.UUID]*Connection `json:"-"`
Color Rgba `json:"color"`
}
type UserProfileUpdateList struct {
@@ -95,6 +95,13 @@ func (conn *Connection) GetSortedMessagesBuff() ([]*Message, uint32) {
return sorted, size
}
func (conn *Connection) GetSecondUser(id uuid.UUID) uuid.UUID {
if id == conn.RequestorId {
return conn.RecipientId
}
return conn.RequestorId
}
type ConnectionStatusSetData struct {
Id uuid.UUID `json:"id"`
NewState ConnectionState.ConnectionState `json:"newState"`