From 558719d36f1013c7c6fe081d849c803b375398a9 Mon Sep 17 00:00:00 2001 From: Matias Insaurralde Date: Wed, 29 Mar 2017 09:22:13 -0400 Subject: [PATCH] Minor updates --- proxy_test.go | 1 - transport_whatsapp.go | 8 ++++---- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/proxy_test.go b/proxy_test.go index e2c3550..07ec414 100644 --- a/proxy_test.go +++ b/proxy_test.go @@ -1,7 +1,6 @@ package transports import ( - "fmt" "testing" ) diff --git a/transport_whatsapp.go b/transport_whatsapp.go index a4f066a..efc904f 100644 --- a/transport_whatsapp.go +++ b/transport_whatsapp.go @@ -30,7 +30,7 @@ type WhatsappTransport struct { } type WhatsappMessage struct { - Id string `json:"id,omitempty"` + ID string `json:"id,omitempty"` Body string `json:"msg,omitempty"` Origin string `json:"origin,omitempty"` Dest string `json:"dest,omitempty"` @@ -54,7 +54,7 @@ func (t *WhatsappTransport) DaemonizeWrapper() { func (t *WhatsappTransport) GetMessageIDs() []string { ids := make([]string, 0) for _, message := range t.Messages { - ids = append(ids, message.Id) + ids = append(ids, message.ID) } return ids } @@ -90,7 +90,7 @@ func (t *WhatsappTransport) FetchMessages() { for id, values := range messageList { valuesMap := values.(map[string]interface{}) - message := WhatsappMessage{Id: id, Body: valuesMap["body"].(string), Origin: valuesMap["origin"].(string)} + message := WhatsappMessage{ID: id, Body: valuesMap["body"].(string), Origin: valuesMap["origin"].(string)} exists := false for _, existingID := range messageIDs { @@ -161,7 +161,7 @@ func (t *WhatsappTransport) HandleClientMessages() { response := t.Serializer.DeserializeResponse([]byte(Value.Body)) - t.PurgeMessage(Value.Id) + t.PurgeMessage(Value.ID) go func(r Response) { ResponseChannel <- response