Skip to content

Commit

Permalink
Minor updates
Browse files Browse the repository at this point in the history
  • Loading branch information
matiasinsaurralde committed Mar 29, 2017
1 parent f264542 commit 558719d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
1 change: 0 additions & 1 deletion proxy_test.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package transports

import (
"fmt"
"testing"
)

Expand Down
8 changes: 4 additions & 4 deletions transport_whatsapp.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"`
Expand All @@ -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
}
Expand Down Expand Up @@ -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 {
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 558719d

Please sign in to comment.