define('FRIENDICA_CODENAME', 'Asparagus');
define('FRIENDICA_VERSION', '3.6-dev');
define('DFRN_PROTOCOL_VERSION', '2.23');
-define('DB_UPDATE_VERSION', 1238);
+define('DB_UPDATE_VERSION', 1239);
define('NEW_UPDATE_ROUTINE_VERSION', 1170);
/**
-- ------------------------------------------
-- Friendica 3.6-dev (Asparagus)
--- DB_UPDATE_VERSION 1238
+-- DB_UPDATE_VERSION 1239
-- ------------------------------------------
INDEX `uid_created` (`uid`,`created`),
INDEX `uid_commented` (`uid`,`commented`),
INDEX `uid_wall_created` (`uid`,`wall`,`created`),
- INDEX `private_wall_received` (`private`,`wall`,`received`)
+ INDEX `private_wall_commented` (`private`,`wall`,`commented`)
) DEFAULT COLLATE utf8mb4_general_ci;
--
item_joins() . " AND `contact`.`self`
WHERE `thread`.`visible` AND NOT `thread`.`deleted` AND NOT `thread`.`moderated`
AND NOT `thread`.`private` AND `thread`.`wall`
- ORDER BY `thread`.`received` DESC LIMIT " . intval($start) . ", " . intval($itemspage)
+ ORDER BY `thread`.`commented` DESC LIMIT " . intval($start) . ", " . intval($itemspage)
);
return dba::inArray($r);
} elseif ($content == 'global') {
$r = dba::p("SELECT " . item_fieldlists() . " FROM `thread`
INNER JOIN `item` ON `item`.`id` = `thread`.`iid` " . item_joins() .
"WHERE `thread`.`uid` = 0 AND `verb` = ?
- ORDER BY `thread`.`created` DESC LIMIT " . intval($start) . ", " . intval($itemspage),
+ ORDER BY `thread`.`commented` DESC LIMIT " . intval($start) . ", " . intval($itemspage),
ACTIVITY_POST
);
return dba::inArray($r);
"uid_created" => array("uid","created"),
"uid_commented" => array("uid","commented"),
"uid_wall_created" => array("uid","wall","created"),
- "private_wall_received" => array("private","wall","received"),
+ "private_wall_commented" => array("private","wall","commented"),
)
);
$database["tokens"] = array(
$qcomment = (($qc) ? explode("\n", $qc) : null);
}
+ // Fetch the user id from the parent when the owner user is empty
+ $uid = $conv->getProfileOwner();
+ $parent_uid = $this->getDataValue('uid');
+
+ if (!empty($parent_uid) && empty($uid) && ($uid != $parent_uid)) {
+ $uid = $parent_uid;
+ }
+
$template = get_markup_template($this->getCommentBoxTemplate());
$comment_box = replace_macros($template, array(
'$return_path' => $a->query_string,
'$id' => $this->getId(),
'$parent' => $this->getId(),
'$qcomment' => $qcomment,
- '$profile_uid' => $conv->getProfileOwner(),
+ '$profile_uid' => $uid,
'$mylink' => $a->remove_baseurl($a->contact['url']),
'$mytitle' => t('This is you'),
'$myphoto' => $a->remove_baseurl($a->contact['thumb']),
$this->writable = can_write_wall($this->profile_owner) || $writable;
break;
case 'community':
- $this->profile_owner = local_user();
+ $this->profile_owner = 0;
$this->writable = $writable;
break;
default: