// The signed text contains the content in Markdown, the sender handle and the signatur for the content
// It is needed for relayed comments to Diaspora.
- if ($item['signed_text']) {
+ if($item['signed_text']) {
$sign = base64_encode(json_encode(array('signed_text' => $item['signed_text'],'signature' => $item['signature'],'signer' => $item['signer'])));
xml::add_element($doc, $entry, "dfrn:diaspora_signature", $sign);
}
if ($dfrn_version >= 2.1) {
- if (($contact['duplex'] && strlen($contact['pubkey']))
+ if (($contact['duplex'] && strlen($contact['pubkey'])) {
|| ($owner['page-flags'] == PAGE_COMMUNITY && strlen($contact['pubkey']))
- || ($contact['rel'] == CONTACT_IS_SHARING && strlen($contact['pubkey']))) {
+ || ($contact['rel'] == CONTACT_IS_SHARING && strlen($contact['pubkey'])))
openssl_public_encrypt($key,$postvars['key'],$contact['pubkey']);
} else {
return 3;
}
- if ($contact['term-date'] != '0000-00-00 00:00:00') {
+ if ($contact['term-date'] > NULL_DATE) {
logger("dfrn_deliver: $url back from the dead - removing mark for death");
require_once('include/Contact.php');
unmark_for_death($contact);
$href = "";
$width = 0;
foreach ($avatar->attributes AS $attributes) {
- /// @TODO Rewrite these similar if () to one switch
+ /// @TODO Rewrite these similar if() to one switch
if ($attributes->name == "href") {
$href = $attributes->textContent;
}
if (edited_timestamp_is_newer($current, $item)) {
// do not accept (ignore) an earlier edit than one we currently have.
- if (datetime_convert("UTC","UTC",$item["edited"]) < $current["edited"])
+ if(datetime_convert("UTC","UTC",$item["edited"]) < $current["edited"])
return(false);
$r = q("UPDATE `item` SET `title` = '%s', `body` = '%s', `tag` = '%s', `edited` = '%s', `changed` = '%s' WHERE `uri` = '%s' AND `uid` = %d",
if ($item["parent-uri"] != $item["uri"]) {
$community = false;
- if ($importer["page-flags"] == PAGE_COMMUNITY || $importer["page-flags"] == PAGE_PRVGROUP) {
+ if($importer["page-flags"] == PAGE_COMMUNITY || $importer["page-flags"] == PAGE_PRVGROUP) {
$sql_extra = "";
$community = true;
logger("possible community action");
}
}
- if ($Blink && link_compare($Blink,App::get_baseurl()."/profile/".$importer["nickname"])) {
+ if($Blink && link_compare($Blink,App::get_baseurl()."/profile/".$importer["nickname"])) {
// send a notification
notification(array(
return false;
}
} else {
- if (($item["verb"] == ACTIVITY_LIKE)
+ if(($item["verb"] == ACTIVITY_LIKE)
|| ($item["verb"] == ACTIVITY_DISLIKE)
|| ($item["verb"] == ACTIVITY_ATTEND)
|| ($item["verb"] == ACTIVITY_ATTENDNO)
$title = "";
foreach ($links AS $link) {
foreach ($link->attributes AS $attributes) {
- /// @TODO Rewrite these repeated (same) if () statements to a switch()
+ /// @TODO Rewrite these repeated (same) if() statements to a switch()
if ($attributes->name == "href") {
$href = $attributes->textContent;
}
// When activated, forums don't work.
// And: Why should we disallow commenting by followers?
// the behaviour is now similar to the Diaspora part.
- //if ($importer["rel"] == CONTACT_IS_FOLLOWER) {
+ //if($importer["rel"] == CONTACT_IS_FOLLOWER) {
// logger("Contact ".$importer["id"]." is only follower. Quitting", LOGGER_DEBUG);
// return;
//}
// Update content if 'updated' changes
if (dbm::is_result($current)) {
- if (self::update_content($r[0], $item, $importer, $entrytype))
+ if (self::update_content($r[0], $item, $importer, $entrytype)) {
logger("Item ".$item["uri"]." was updated.", LOGGER_DEBUG);
} else {
logger("Item ".$item["uri"]." already existed.", LOGGER_DEBUG);
logger("Item was stored with id ".$posted_id, LOGGER_DEBUG);
- if (stristr($item["verb"],ACTIVITY_POKE))
+ if(stristr($item["verb"],ACTIVITY_POKE))
self::do_poke($item, $importer, $posted_id);
}
}
}
}
- if ($entrytype == DFRN_TOP_LEVEL) {
+ if($entrytype == DFRN_TOP_LEVEL) {
$r = q("UPDATE `item` SET `deleted` = 1, `edited` = '%s', `changed` = '%s',
`body` = '', `title` = ''
WHERE `parent-uri` = '%s' AND `uid` = %d",
create_tags_from_itemuri($uri, $importer["uid"]);
create_files_from_itemuri($uri, $importer["uid"]);
update_thread_uri($uri, $importer["importer_uid"]);
- if ($item["last-child"]) {
+ if($item["last-child"]) {
// ensure that last-child is set in case the comment that had it just got wiped.
q("UPDATE `item` SET `last-child` = 0, `changed` = '%s' WHERE `parent-uri` = '%s' AND `uid` = %d ",
dbesc(datetime_convert()),
}
// if this is a relayed delete, propagate it to other recipients
- if ($entrytype == DFRN_REPLY_RC) {
+ if($entrytype == DFRN_REPLY_RC) {
logger("Notifying followers about deletion of post ".$item["id"], LOGGER_DEBUG);
proc_run(PRIORITY_HIGH, "include/notifier.php","drop", $item["id"]);
}
if ($xml == "")
return;
- if ($importer["readonly"]) {
+ if($importer["readonly"]) {
// We aren't receiving stuff from this person. But we will quietly ignore them
// rather than a blatant "go away" message.
logger('ignoring contact '.$importer["id"]);