* @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();
$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...)