From b94b92c2d2f8cfa8635797f3fafa7199dd35cfec Mon Sep 17 00:00:00 2001 From: Hamcha Date: Tue, 9 Feb 2016 10:39:00 +0000 Subject: [PATCH] It's official, I'm retarded --- broker/clients.go | 2 +- tg/broker.go | 2 +- tg/client.go | 3 ++- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/broker/clients.go b/broker/clients.go index e1aae23..cc05089 100644 --- a/broker/clients.go +++ b/broker/clients.go @@ -42,7 +42,7 @@ func handleClient(c net.Conn) { err = json.Unmarshal(bytes, &cmd) if err != nil { log.Printf("[handleClient] Can't parse JSON: %s\r\n", err.Error()) - log.Println(string(bytes)) + log.Printf("%s\n", string(bytes)) continue } executeClientCommand(cmd) diff --git a/tg/broker.go b/tg/broker.go index d0d5e88..4fc2059 100644 --- a/tg/broker.go +++ b/tg/broker.go @@ -40,5 +40,5 @@ func (b *Broker) SendTextMessage(chat *APIChat, text string, original *int) { if err != nil { log.Printf("[SendTextMessage] JSON Encode error: %s\n", err.Error()) } - fmt.Fprintln(b.Socket, data) + fmt.Fprintln(b.Socket, string(data)) } diff --git a/tg/client.go b/tg/client.go index a7d2b57..a8ebdc0 100644 --- a/tg/client.go +++ b/tg/client.go @@ -27,7 +27,8 @@ func CreateBrokerClient(brokerAddr string, updateFn UpdateHandler) error { err = json.Unmarshal(bytes, &update) if err != nil { log.Printf("[tg - CreateBrokerClient] ERROR reading JSON: %s\r\n", err.Error()) - log.Println(string(bytes)) + log.Printf("%s\n", string(bytes)) + continue } // Dispatch to UpdateHandler