*/
protected function handle()
{
- parent::handle();
+ parent::handle($args);
if (!in_array($this->format, array('xml', 'json'))) {
// TRANS: Client error displayed when coming across a non-supported API method.
*/
protected function handle()
{
- parent::handle();
+ parent::handle($args);
// Workaround for PHP returning empty $_POST and $_FILES when POST
// length > post_max_size in php.ini
$this->elementEnd('div');
}
- public function isReadOnly(array $args = array())
+ public function isReadOnly(array $args=array())
{
return true;
}
}
}
+ // Debug log (convert crop to int to have TRUE being displayed as 1 and FALSE as 0)
+ /* NOISY-DEBUG: */ common_debug('[' . __METHOD__ . ':' . __LINE__ . ']: width=' . $width . ',height=' . $height . ',crop=' . intval($crop));
+
return $image->getFileThumbnail($width, $height, $crop);
}
return $this->file;
}
-}
\ No newline at end of file
+}
print ".";
}
print "\n";
+
+ /**
+ * Checks whether this notice is in "private scope" (non-public notice)
+ *
+ * @return $isPrivate Whether this notice is private
+ */
+ public function isPrivateScope ()
+ {
+ return ($this->scope != Notice::SITE_SCOPE &&
+ $this->scope != Notice::PUBLIC_SCOPE);
}
}
foreach (array('profile', 'avatar', 'password', 'im', 'oauthconnections',
'oauthapps', 'email', 'sms', 'url') as $s) {
- $m->connect('settings/'.$s, array('action' => $s.'settings'));
+ $m->connect('settings/' . $s, array('action' => $s . 'settings'));
}
if (common_config('oldschool', 'enabled')) {
return $hostname;
}
- function onStartHandleFeedEntry($activity)
+ function onStartHandleFeedEntry(Activity $activity)
{
return $this->_checkActivity($activity);
}
- function onStartHandleSalmon($activity)
+ function onStartHandleSalmon(Activity $activity)
{
return $this->_checkActivity($activity);
}
- function _checkActivity($activity)
+ function _checkActivity(Activity $activity)
{
$actor = $activity->actor;
* @return Bookmark The found bookmark object.
* @throws NoResultException When you don't find it after all.
*/
+<<<<<<< .merge_file_ZPs3Af
static public function fromStored(Notice $stored)
{
return self::getByPK(array('uri' => $stored->getUri()));
}
public function getStored()
+=======
+ static function getByNotice(Notice $notice)
+>>>>>>> .merge_file_eD7Wwf
{
return Notice::getByKeys(array('uri' => $this->getUri()));
}
*
* @return Bookmark the Bookmark object
*/
+<<<<<<< .merge_file_ZPs3Af
static function saveActivityObject(ActivityObject $actobj, Notice $stored)
+=======
+ static function saveNew(Profile $profile, $title, $url, $rawtags, $description,
+ array $options=array())
+>>>>>>> .merge_file_eD7Wwf
{
$url = null;
// each extra element is array('tagname', array('attr'=>'val', ...), 'content')
throw new ClientException(sprintf(_m('Expected exactly 1 link rel=related in a Bookmark, got %1$d.'), count($relLinkEls)));
}
+<<<<<<< .merge_file_ZPs3Af
if (!strlen($actobj->title)) {
throw new ClientException(_m('You must provide a non-empty title.'));
}
if (!common_valid_http_url($url)) {
throw new ClientException(_m('Only web bookmarks can be posted (HTTP or HTTPS).'));
+=======
+ if (array_key_exists('uri', $options)) {
+ $other = Bookmark::getKV('uri', $options['uri']);
+ if (!empty($other)) {
+ // TRANS: Client exception thrown when trying to save a new bookmark that already exists.
+ throw new ClientException(_m('Bookmark already exists.'));
+ }
+>>>>>>> .merge_file_eD7Wwf
}
try {
);
}
+<<<<<<< .merge_file_oq2F7C
static public function beforeSchemaUpdate()
+=======
+ function saveNew(Profile $profile, $event, $verb, array $options = array())
+>>>>>>> .merge_file_L3oA6C
{
$table = strtolower(get_called_class());
$schema = Schema::get();
* @param Notice $notice
* @return boolean event hook return
*/
- function onStartNoticeDistribute($notice)
+ function onStartNoticeDistribute(Notice $notice)
{
$profile = $notice->getProfile();
return true;
}
- function onStartNoticeDistribute($notice)
+ function onStartNoticeDistribute(Notice $notice)
{
common_log(LOG_INFO, "event: StartNoticeDistribute");
if (GNUsocialPhotoTemp::$tmp) {
}
- function onStartHandleFeedEntry($activity)
+ function onStartHandleFeedEntry(Activity $activity)
{
common_log(LOG_INFO, 'photo plugin: onEndAtomPubNewActivity');
$oprofile = Ostatus_profile::ensureActorProfile($activity);
return true;
}
- function onStartShowNoticeItem($action)
+ function onStartShowNoticeItem(Action $action)
{
$photo = GNUsocialPhoto::getKV('notice_id', $action->notice->id);
if($photo) {
$temp_filename = tempnam(common_get_temp_dir(), 'listener_avatar');
try {
$imgData = HTTPClient::quickGet($url);
+
// Make sure it's at least an image file. ImageFile can do the rest.
if (false === getimagesizefromstring($imgData)) {
throw new UnsupportedMediaException(_('Downloaded group avatar was not an image.'));
}
+
file_put_contents($temp_filename, $imgData);
unset($imgData); // No need to carry this in memory.
$this->clientError($e->getMessage());
}
+<<<<<<< .merge_file_l1W8if
// Cryptographic verification test, throws exception on failure
$magic_env->verify($this->actor);
+=======
+ // Cryptographic verification test
+ if (!$magic_env->verify($this->actor)) {
+ common_debug("Salmon signature verification failed.");
+ // TRANS: Client error.
+ $this->clientError(_m('Salmon signature verification failed.'));
+ }
+>>>>>>> .merge_file_ISiK5f
return true;
}
var $access_token = null;
var $verifier = null;
+<<<<<<< .merge_file_Bq71r4
protected $needLogin = false; // authorization page can also be used to create a new user
+=======
+ /**
+ * Initialize class members. Looks for 'oauth_token' parameter.
+ *
+ * @param array $args misc. arguments
+ *
+ * @return boolean true
+ */
+ function prepare(array $args=array())
+ {
+ parent::prepare($args);
+>>>>>>> .merge_file_Ad5nH4
protected function doPreparation()
{
$this->oauth_token = $this->arg('oauth_token');
$this->verifier = $this->arg('oauth_verifier');
+<<<<<<< .merge_file_Bq71r4
if ($this->scoped instanceof Profile) {
try {
$flink = Foreign_link::getByUserID($this->scoped->getID(), TWITTER_SERVICE);
$fuser = $flink->getForeignUser();
+=======
+ return true;
+ }
+
+ /**
+ * Handler method
+ *
+ * @param array $args is ignored since it's now passed in in prepare()
+ *
+ * @return nothing
+ */
+ function handle(array $args=array())
+ {
+ parent::handle($args);
+
+ if (common_logged_in()) {
+ $user = common_current_user();
+ $flink = Foreign_link::getByUserID($user->id, TWITTER_SERVICE);
+>>>>>>> .merge_file_Ad5nH4
// If there's already a foreign link record and a foreign user
// (no exceptions were thrown when fetching either of them...)