Skip to content

Commit

Permalink
add EnableReadOnly method
Browse files Browse the repository at this point in the history
  • Loading branch information
Sagleft committed Feb 15, 2023
1 parent 3108909 commit 1cdba57
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
8 changes: 8 additions & 0 deletions v2/internal/utopia/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
3 changes: 3 additions & 0 deletions v2/messenger.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 1cdba57

Please sign in to comment.