From a8cbe886bab05a8bac9044b0ea8970ebc000a42a Mon Sep 17 00:00:00 2001 From: DesSolo Date: Tue, 16 Jan 2024 16:42:46 +0300 Subject: [PATCH] Add public method DDP (#75) --- realtime/client.go | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/realtime/client.go b/realtime/client.go index c69abb1..6a7c06f 100644 --- a/realtime/client.go +++ b/realtime/client.go @@ -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 ( @@ -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 { @@ -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}) }