diff --git a/signald/client-protocol/protocol.go b/signald/client-protocol/protocol.go index d354c53..e625226 100644 --- a/signald/client-protocol/protocol.go +++ b/signald/client-protocol/protocol.go @@ -2,6 +2,7 @@ package client_protocol import ( "encoding/json" + ) type BasicResponse struct { @@ -10,4 +11,5 @@ type BasicResponse struct { ErrorType string Error json.RawMessage Data json.RawMessage -} + Account string +} \ No newline at end of file diff --git a/signald/signald.go b/signald/signald.go index c8a4897..5a0f9d8 100644 --- a/signald/signald.go +++ b/signald/signald.go @@ -29,7 +29,6 @@ import ( "time" client_protocol "gitlab.com/signald/signald-go/signald/client-protocol" - "gitlab.com/signald/signald-go/signald/client-protocol/v0" ) const ( @@ -101,7 +100,7 @@ func (s *Signald) connect() error { } // Listen listens for events from signald -func (s *Signald) Listen(c chan v0.LegacyResponse) { +func (s *Signald) Listen(c chan client_protocol.BasicResponse) { for { msg, err := s.readNext() if err == io.EOF { @@ -127,12 +126,7 @@ func (s *Signald) Listen(c chan v0.LegacyResponse) { } if c != nil { - legacyResponse := v0.LegacyResponse{ID: msg.ID, Type: msg.Type} - if err := json.Unmarshal(msg.Data, &legacyResponse.Data); err != nil { - log.Println("signald-go receive error: ", err) - } else { - c <- legacyResponse - } + c <- msg } } }