Thumbnail

rani/matterbridge.git

Clone URL: https://git.buni.party/rani/matterbridge.git

commit 2fe1dd3bc66d53fcc69398f694b61162ee9625fa Author: Wim <wim@42.be> Date: Sun Aug 09 21:46:03 2020 +0000 Add EnableAllEvents Add option to have all events send to the messagechan diff --git a/matterclient/matterclient.go b/matterclient/matterclient.go index 338f86d..35d620c 100644 --- a/matterclient/matterclient.go +++ b/matterclient/matterclient.go @@ -696 +697 @@ type MMClient struct {   logger *logrus.Entry   rootLogger *logrus.Logger   lruCache *lru.Cache + allevents bool  }    // New will instantiate a new Matterclient with the specified login details without connecting. @@ -1196 +12010 @@ func (m *MMClient) SetLogLevel(level string) {   }  }   +func (m *MMClient) EnableAllEvents() { + m.allevents = true +} +  // Login tries to connect the client with the loging details with which it was initialized.  func (m *MMClient) Login() error {   // check if this is a first connect or a reconnection @@ -2206 +22510 @@ func (m *MMClient) WsReceiver() {   continue   }   } + if m.allevents { + m.MessageChan <- msg + continue + }   switch msg.Raw.Event {   case model.WEBSOCKET_EVENT_USER_ADDED,   model.WEBSOCKET_EVENT_USER_REMOVED,