mirror of
https://github.com/signaller-matrix/signaller.git
synced 2024-12-22 08:51:50 +00:00
Implement room state field
This commit is contained in:
parent
b7d0ca2b9f
commit
e293cd0255
@ -26,6 +26,7 @@ type Room interface {
|
||||
Topic() string
|
||||
Events() []rooms.Event
|
||||
Visibility() createroom.VisibilityType
|
||||
State() createroom.Preset
|
||||
}
|
||||
|
||||
type User interface {
|
||||
|
@ -14,6 +14,7 @@ type Room struct {
|
||||
aliasName string
|
||||
name string
|
||||
topic string
|
||||
state createroom.Preset
|
||||
|
||||
creator internal.User
|
||||
joined []internal.User
|
||||
@ -85,3 +86,10 @@ func (room *Room) Creator() internal.User {
|
||||
|
||||
return room.creator
|
||||
}
|
||||
|
||||
func (room *Room) State() createroom.Preset {
|
||||
room.mutex.RLock()
|
||||
defer room.mutex.RUnlock()
|
||||
|
||||
return room.state
|
||||
}
|
||||
|
@ -16,8 +16,8 @@ type Preset string
|
||||
|
||||
const (
|
||||
PrivateChat Preset = "private_chat"
|
||||
PublicChat = "public_chat"
|
||||
TrustedPrivateChat = "trusted_private_chat"
|
||||
PublicChat Preset = "public_chat"
|
||||
TrustedPrivateChat Preset = "trusted_private_chat"
|
||||
)
|
||||
|
||||
// Invite3pid represents third party IDs to invite into the room
|
||||
|
Loading…
Reference in New Issue
Block a user