Skip to content

Commit

Permalink
Fixes for 32 bit
Browse files Browse the repository at this point in the history
  • Loading branch information
crimsonred committed Jan 14, 2019
1 parent 722fb02 commit 35649df
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
2 changes: 1 addition & 1 deletion history_request.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
3 changes: 3 additions & 0 deletions subscription_manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions subscription_manager_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -403,7 +403,7 @@ func TestProcessSubscribePayload(t *testing.T) {

payload := &map[string]interface{}{
"action": "join",
"timestamp": 15078947309567840,
"timestamp": int64(15078947309567840),
"uuid": "bfce00ff4018fce180438bb04afc8da8",
"occupancy": 1,
}
Expand Down Expand Up @@ -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,
Expand Down

0 comments on commit 35649df

Please sign in to comment.