From 28f0c40601fd6970324c2d7193780a5b5ed2f291 Mon Sep 17 00:00:00 2001 From: mgp25 Date: Sat, 25 Jul 2015 10:57:04 +0200 Subject: [PATCH] getConversations fix --- src/snapchat.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/snapchat.php b/src/snapchat.php index 14901a3..4597bec 100644 --- a/src/snapchat.php +++ b/src/snapchat.php @@ -874,7 +874,9 @@ public function sendMessage($tos, $text){ public function getConversations() { $updates = $this->getUpdates(); - $offset = end($updates['data']->conversations_response)->iter_token; + $last = end($updates['data']->conversations_response); + if (isset($last->iter_token)) + $offset = $last->iter_token; $convos = $updates['data']->conversations_response; while(strlen($offset) > 0){ $timestamp = parent::timestamp();