Skip to content

Commit

Permalink
Add public method DDP (#75)
Browse files Browse the repository at this point in the history
  • Loading branch information
DesSolo authored Jan 16, 2024
1 parent a3fd332 commit a8cbe88
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions realtime/client.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//Package realtime provides access to Rocket.Chat's realtime API via ddp
// Package realtime provides access to Rocket.Chat's realtime API via ddp
package realtime

import (
Expand All @@ -17,7 +17,7 @@ type Client struct {
sf *sonyflake.Sonyflake
}

//NewClient creates a new instance and connects to the websocket.
// NewClient creates a new instance and connects to the websocket.
func NewClient(serverURL *url.URL, debug bool) (*Client, error) {
sf := sonyflake.NewSonyflake(sonyflake.Settings{})
if sf == nil {
Expand Down Expand Up @@ -63,6 +63,10 @@ func (s statusListener) Status(status int) {
s.listener(status)
}

func (c *Client) DDP() *ddp.Client {
return c.ddp
}

func (c *Client) AddStatusListener(listener func(int)) {
c.ddp.AddStatusListener(statusListener{listener: listener})
}
Expand Down

0 comments on commit a8cbe88

Please sign in to comment.