diff --git a/src/snapchat.php b/src/snapchat.php index fe64534..4ec50c3 100755 --- a/src/snapchat.php +++ b/src/snapchat.php @@ -230,6 +230,12 @@ public function register($username, $password, $email, $birthday) { * The data returned by the service or FALSE on failure. */ public function getUpdates($force = FALSE) { + + // Make sure we're logged in and have a valid access token. + if (!$this->auth_token || !$this->username) { + return FALSE; + } + if (!$force) { $result = $this->cache->get('updates'); if ($result) { @@ -237,11 +243,6 @@ public function getUpdates($force = FALSE) { } } - // Make sure we're logged in and have a valid access token. - if (!$this->auth_token || !$this->username) { - return FALSE; - } - $timestamp = parent::timestamp(); $result = parent::post( '/all_updates', @@ -312,7 +313,13 @@ public function getSnaps() { * @return mixed * An array of stories or FALSE on failure. */ - function getFriendStories($force = FALSE) { + public function getFriendStories($force = FALSE) { + + // Make sure we're logged in and have a valid access token. + if (!$this->auth_token || !$this->username) { + return FALSE; + } + if (!$force) { $result = $this->cache->get('stories'); if ($result) { @@ -320,11 +327,6 @@ function getFriendStories($force = FALSE) { } } - // Make sure we're logged in and have a valid access token. - if (!$this->auth_token || !$this->username) { - return FALSE; - } - $timestamp = parent::timestamp(); $result = parent::post( '/all_updates',