diff --git a/v2/internal/utopia/client.go b/v2/internal/utopia/client.go index a80b011..46147dd 100644 --- a/v2/internal/utopia/client.go +++ b/v2/internal/utopia/client.go @@ -463,3 +463,11 @@ func (c *UtopiaClient) GetNetworkConnections() ([]structs.PeerInfo, error) { return data.Connections, nil } + +func (c *UtopiaClient) EnableReadOnly(channelID string, readOnly bool) error { + _, err := c.apiQuery("modifyChannel", map[string]interface{}{ + "channelid": channelID, + "read_only": readOnly, + }) + return err +} diff --git a/v2/messenger.go b/v2/messenger.go index 93b6ded..6f7fae6 100644 --- a/v2/messenger.go +++ b/v2/messenger.go @@ -128,6 +128,9 @@ type Client interface { // GetNetworkConnections - get current network peers GetNetworkConnections() ([]structs.PeerInfo, error) + + // EnableReadOnly - convert chat to channel + EnableReadOnly(channelID string, readOnly bool) error } type Config = utopia.Config