diff --git a/history_request.go b/history_request.go index 6baad636..8756fd59 100644 --- a/history_request.go +++ b/history_request.go @@ -251,7 +251,7 @@ func parseInterface(vv []interface{}, o *historyOpts) []HistoryResponseItem { s := fmt.Sprintf("%.0f", f) o.pubnub.Config.Log.Println("s:", s) - if tt, err := strconv.Atoi(s); err == nil { + if tt, err := strconv.ParseInt(s, 10, 64); err == nil { o.pubnub.Config.Log.Println("tt:", tt) items[i].Timetoken = int64(tt) } else { diff --git a/subscription_manager.go b/subscription_manager.go index 45878bbf..61c413a6 100644 --- a/subscription_manager.go +++ b/subscription_manager.go @@ -573,6 +573,9 @@ func processSubscribePayload(m *SubscriptionManager, payload subscribeMessage) { case int: timestamp = int64(presencePayload["timestamp"].(int)) break + case int64: + timestamp = presencePayload["timestamp"].(int64) + break case float64: timestamp = int64(presencePayload["timestamp"].(float64)) break diff --git a/subscription_manager_test.go b/subscription_manager_test.go index 68eddb37..7d576cf8 100644 --- a/subscription_manager_test.go +++ b/subscription_manager_test.go @@ -403,7 +403,7 @@ func TestProcessSubscribePayload(t *testing.T) { payload := &map[string]interface{}{ "action": "join", - "timestamp": 15078947309567840, + "timestamp": int64(15078947309567840), "uuid": "bfce00ff4018fce180438bb04afc8da8", "occupancy": 1, } @@ -504,7 +504,7 @@ func TestProcessSubscribePayloadSubMatch(t *testing.T) { payload := &map[string]interface{}{ "action": "join", - "timestamp": 15078947309567840, + "timestamp": int64(15078947309567840), "uuid": "bfce00ff4018fce180438bb04afc8da8", "occupancy": 1, "here_now_refresh": true,