add new event types
This commit is contained in:
+19
-12
@@ -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"`
|
||||
|
||||
Reference in New Issue
Block a user