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