Skip to content
This repository has been archived by the owner on Dec 16, 2020. It is now read-only.

Commit

Permalink
add story privacy settings
Browse files Browse the repository at this point in the history
  • Loading branch information
teknogeek committed Sep 23, 2015
1 parent 4530807 commit 5dcce35
Showing 1 changed file with 32 additions and 1 deletion.
33 changes: 32 additions & 1 deletion src/snapchat.php
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,8 @@ public function device()
return $result;
}



public function getAttestation($password, $timestamp)
{
$binary = file_get_contents("https://api.casper.io/droidguard/create/binary");
Expand Down Expand Up @@ -3054,7 +3056,7 @@ public function updatePrivacy($setting)

$timestamp = parent::timestamp();
$result = parent::post(
'/bq/settings',
'/ph/settings',
array(
'action' => 'updatePrivacy',
'privacySetting' => $setting,
Expand All @@ -3072,6 +3074,35 @@ public function updatePrivacy($setting)
return isset($result->param) && $result->param == $setting;
}

public function updateStoryPrivacy($setting = "EVERYONE")
{
if(!$this->auth_token || !$this->username)
{
return FALSE;
}

$setting = strcasecmp($setting, "everyone") ? "EVERYONE" : strcasecmp($setting, "friends") ? "FRIENDS" : "EVERYONE";

$timestamp = parent::timestamp();
$result = parent::post(
"/ph/settings",
array(
"action" => "updateStoryPrivacy",
"privacySetting" => $setting,
"timestamp" => $timestamp,
"username" => $this->username
),
array(
$this->auth_token,
$timestamp,
),
$multipart = false,
$debug = $this->debug
);

return isset($result->param) && $result->param == $setting;
}

/**
* Updates the current user's email address.
*
Expand Down

0 comments on commit 5dcce35

Please sign in to comment.