$created_at = datetime_convert("UTC", "UTC", notags(unxmlify($data->created_at)));
$contact = self::allowed_contact_by_handle($importer, $author, false);
-- if (!$contact)
++ if (!$contact) {
return false;
++ }
$message_id = self::message_exists($importer["uid"], $guid);
-- if ($message_id)
++ if ($message_id) {
return $message_id;
++ }
$original_item = self::original_item($root_guid, $root_author, $author);
-- if (!$original_item)
++ if (!$original_item) {
return false;
++ }
$orig_url = App::get_baseurl()."/display/".$original_item["guid"];
self::fetch_guid($datarray);
$message_id = item_store($datarray);
-- if ($message_id)
++ if ($message_id) {
logger("Stored reshare ".$datarray["guid"]." with message id ".$message_id, LOGGER_DEBUG);
++ }
return $message_id;
}
dbesc($target_guid),
intval($importer["uid"])
);
-- if (!$r)
++ if (!$r) {
return false;
++ }
// Check if the sender is the thread owner
$p = q("SELECT `id`, `author-link`, `origin` FROM `item` WHERE `id` = %d",
logger("Deleted target ".$target_guid." (".$r[0]["id"].") from user ".$importer["uid"]." parent: ".$p[0]["id"], LOGGER_DEBUG);
// Now check if the retraction needs to be relayed by us
-- if($p[0]["origin"]) {
++ if ($p[0]["origin"]) {
// notify others
proc_run(PRIORITY_HIGH, "include/notifier.php", "drop", $r[0]["id"]);
}
* @return string the handle in the format user@domain.tld
*/
private function my_handle($contact) {
-- if ($contact["addr"] != "")
++ if ($contact["addr"] != "") {
return $contact["addr"];
++ }
// Normally we should have a filled "addr" field - but in the past this wasn't the case
// So - just in case - we build the the address here.
-- if ($contact["nickname"] != "")
++ if ($contact["nickname"] != "") {
$nick = $contact["nickname"];
-- else
++ } else {
$nick = $contact["nick"];
++ }
return $nick."@".substr(App::get_baseurl(), strpos(App::get_baseurl(),"://") + 3);
}
$this->set_template('wall');
$this->toplevel = ($this->get_id() == $this->get_data_value('parent'));
-- if(is_array($_SESSION['remote'])) {
-- foreach($_SESSION['remote'] as $visitor) {
-- if($visitor['cid'] == $this->get_data_value('contact-id')) {
++ if (is_array($_SESSION['remote'])) {
++ foreach ($_SESSION['remote'] as $visitor) {
++ if ($visitor['cid'] == $this->get_data_value('contact-id')) {
$this->visiting = true;
break;
}
// Diaspora isn't able to do likes on comments - but red does
if (($item["item_network"] == NETWORK_DIASPORA) AND ($indent == 'comment') AND
- !diaspora::is_redmatrix($item["owner-link"]) AND isset($buttons["like"])) {
- !Diaspora::is_redmatrix($item["owner-link"]) AND isset($buttons["like"]))
++ !Diaspora::is_redmatrix($item["owner-link"]) AND isset($buttons["like"])) {
unset($buttons["like"]);
+ }
// Diaspora doesn't has multithreaded comments
- if (($item["item_network"] == NETWORK_DIASPORA) AND ($indent == 'comment'))
+ if (($item["item_network"] == NETWORK_DIASPORA) AND ($indent == 'comment')) {
unset($comment);
+ }
// Facebook can like comments - but it isn't programmed in the connector yet.
- if (($item["item_network"] == NETWORK_FACEBOOK) AND ($indent == 'comment') AND isset($buttons["like"]))
+ if (($item["item_network"] == NETWORK_FACEBOOK) AND ($indent == 'comment') AND isset($buttons["like"])) {
unset($buttons["like"]);
+ }
$tmp_item = array(
- 'template' => $this->get_template(),
-
- 'type' => implode("",array_slice(explode("/",$item['verb']),-1)),
- 'tags' => $item['tags'],
- 'hashtags' => $item['hashtags'],
- 'mentions' => $item['mentions'],
- 'txt_cats' => t('Categories:'),
- 'txt_folders' => t('Filed under:'),
- 'has_cats' => ((count($categories)) ? 'true' : ''),
- 'has_folders' => ((count($folders)) ? 'true' : ''),
- 'categories' => $categories,
- 'folders' => $folders,
- 'body' => $body_e,
- 'text' => $text_e,
- 'id' => $this->get_id(),
- 'guid' => urlencode($item['guid']),
- 'isevent' => $isevent,
- 'attend' => $attend,
- 'linktitle' => sprintf( t('View %s\'s profile @ %s'), $profile_name, ((strlen($item['author-link'])) ? $item['author-link'] : $item['url'])),
- 'olinktitle' => sprintf( t('View %s\'s profile @ %s'), htmlentities($this->get_owner_name()), ((strlen($item['owner-link'])) ? $item['owner-link'] : $item['url'])),
- 'to' => t('to'),
- 'via' => t('via'),
- 'wall' => t('Wall-to-Wall'),
- 'vwall' => t('via Wall-To-Wall:'),
- 'profile_url' => $profile_link,
+ 'template' => $this->get_template(),
+ 'type' => implode("",array_slice(explode("/",$item['verb']),-1)),
+ 'tags' => $item['tags'],
+ 'hashtags' => $item['hashtags'],
+ 'mentions' => $item['mentions'],
+ 'txt_cats' => t('Categories:'),
+ 'txt_folders' => t('Filed under:'),
+ 'has_cats' => ((count($categories)) ? 'true' : ''),
+ 'has_folders' => ((count($folders)) ? 'true' : ''),
+ 'categories' => $categories,
+ 'folders' => $folders,
+ 'body' => $body_e,
+ 'text' => $text_e,
+ 'id' => $this->get_id(),
+ 'guid' => urlencode($item['guid']),
+ 'isevent' => $isevent,
+ 'attend' => $attend,
+ 'linktitle' => sprintf( t('View %s\'s profile @ %s'), $profile_name, ((strlen($item['author-link'])) ? $item['author-link'] : $item['url'])),
+ 'olinktitle' => sprintf( t('View %s\'s profile @ %s'), htmlentities($this->get_owner_name()), ((strlen($item['owner-link'])) ? $item['owner-link'] : $item['url'])),
+ 'to' => t('to'),
+ 'via' => t('via'),
+ 'wall' => t('Wall-to-Wall'),
+ 'vwall' => t('via Wall-To-Wall:'),
+ 'profile_url' => $profile_link,
'item_photo_menu' => item_photo_menu($item),
- 'name' => $name_e,
- 'thumb' => $a->remove_baseurl(proxy_url($item['author-thumb'], false, PROXY_SIZE_THUMB)),
- 'osparkle' => $osparkle,
- 'sparkle' => $sparkle,
- 'title' => $title_e,
- 'localtime' => datetime_convert('UTC', date_default_timezone_get(), $item['created'], 'r'),
- 'ago' => (($item['app']) ? sprintf( t('%s from %s'),relative_date($item['created']),$item['app']) : relative_date($item['created'])),
- 'app' => $item['app'],
- 'created' => relative_date($item['created']),
- 'lock' => $lock,
- 'location' => $location_e,
- 'indent' => $indent,
- 'shiny' => $shiny,
- 'owner_url' => $this->get_owner_url(),
- 'owner_photo' => $a->remove_baseurl(proxy_url($item['owner-thumb'], false, PROXY_SIZE_THUMB)),
- 'owner_name' => htmlentities($owner_name_e),
- 'plink' => get_plink($item),
- 'edpost' => ((feature_enabled($conv->get_profile_owner(),'edit_posts')) ? $edpost : ''),
- 'isstarred' => $isstarred,
- 'star' => ((feature_enabled($conv->get_profile_owner(),'star_posts')) ? $star : ''),
- 'ignore' => ((feature_enabled($conv->get_profile_owner(),'ignore_posts')) ? $ignore : ''),
- 'tagger' => $tagger,
- 'filer' => ((feature_enabled($conv->get_profile_owner(),'filing')) ? $filer : ''),
- 'drop' => $drop,
- 'vote' => $buttons,
- 'like' => $responses['like']['output'],
- 'dislike' => $responses['dislike']['output'],
- 'responses' => $responses,
- 'switchcomment' => t('Comment'),
- 'comment' => $comment,
- 'previewing' => ($conv->is_preview() ? ' preview ' : ''),
- 'wait' => t('Please wait'),
- 'thread_level' => $thread_level,
- 'postopts' => $langstr,
- 'edited' => $edited,
- 'network' => $item["item_network"],
- 'network_name' => network_to_name($item['item_network'], $profile_link),
+ 'name' => $name_e,
+ 'thumb' => $a->remove_baseurl(proxy_url($item['author-thumb'], false, PROXY_SIZE_THUMB)),
+ 'osparkle' => $osparkle,
+ 'sparkle' => $sparkle,
+ 'title' => $title_e,
+ 'localtime' => datetime_convert('UTC', date_default_timezone_get(), $item['created'], 'r'),
+ 'ago' => (($item['app']) ? sprintf( t('%s from %s'),relative_date($item['created']),$item['app']) : relative_date($item['created'])),
+ 'app' => $item['app'],
+ 'created' => relative_date($item['created']),
+ 'lock' => $lock,
+ 'location' => $location_e,
+ 'indent' => $indent,
+ 'shiny' => $shiny,
+ 'owner_url' => $this->get_owner_url(),
+ 'owner_photo' => $a->remove_baseurl(proxy_url($item['owner-thumb'], false, PROXY_SIZE_THUMB)),
+ 'owner_name' => htmlentities($owner_name_e),
+ 'plink' => get_plink($item),
+ 'edpost' => ((feature_enabled($conv->get_profile_owner(),'edit_posts')) ? $edpost : ''),
+ 'isstarred' => $isstarred,
+ 'star' => ((feature_enabled($conv->get_profile_owner(),'star_posts')) ? $star : ''),
+ 'ignore' => ((feature_enabled($conv->get_profile_owner(),'ignore_posts')) ? $ignore : ''),
+ 'tagger' => $tagger,
+ 'filer' => ((feature_enabled($conv->get_profile_owner(),'filing')) ? $filer : ''),
+ 'drop' => $drop,
+ 'vote' => $buttons,
+ 'like' => $responses['like']['output'],
+ 'dislike' => $responses['dislike']['output'],
+ 'responses' => $responses,
+ 'switchcomment' => t('Comment'),
+ 'comment' => $comment,
+ 'previewing' => ($conv->is_preview() ? ' preview ' : ''),
+ 'wait' => t('Please wait'),
+ 'thread_level' => $thread_level,
+ 'postopts' => $langstr,
+ 'edited' => $edited,
+ 'network' => $item["item_network"],
+ 'network_name' => network_to_name($item['item_network'], $profile_link),
);
$arr = array('item' => $item, 'output' => $tmp_item);