Preparation for being able to comment every public item
This commit is contained in:
parent
6f7f839c67
commit
b457ed6876
5 changed files with 80 additions and 71 deletions
|
@ -145,7 +145,8 @@ class Post extends BaseObject
|
|||
|| strlen($item['deny_cid']) || strlen($item['deny_gid']))))
|
||||
? t('Private Message')
|
||||
: false);
|
||||
$shareable = ((($conv->getProfileOwner() == local_user()) && ($item['private'] != 1)) ? true : false);
|
||||
$shareable = ((in_array($conv->getProfileOwner(), [0, local_user()]) && ($item['private'] != 1)) ? true : false);
|
||||
|
||||
if (local_user() && link_compare($a->contact['url'], $item['author-link'])) {
|
||||
if ($item["event-id"] != 0) {
|
||||
$edpost = array("events/event/".$item['event-id'], t("Edit"));
|
||||
|
|
|
@ -29,9 +29,9 @@ class Thread extends BaseObject
|
|||
* @param string $mode The mode
|
||||
* @param boolean $preview boolean value
|
||||
*/
|
||||
public function __construct($mode, $preview)
|
||||
public function __construct($mode, $preview, $writable = false)
|
||||
{
|
||||
$this->setMode($mode);
|
||||
$this->setMode($mode, $writable);
|
||||
$this->preview = $preview;
|
||||
}
|
||||
|
||||
|
@ -42,7 +42,7 @@ class Thread extends BaseObject
|
|||
*
|
||||
* @return void
|
||||
*/
|
||||
private function setMode($mode)
|
||||
private function setMode($mode, $writable)
|
||||
{
|
||||
if ($this->getMode() == $mode) {
|
||||
return;
|
||||
|
@ -62,7 +62,7 @@ class Thread extends BaseObject
|
|||
break;
|
||||
case 'display':
|
||||
$this->profile_owner = $a->profile['uid'];
|
||||
$this->writable = can_write_wall($a, $this->profile_owner);
|
||||
$this->writable = can_write_wall($a, $this->profile_owner) || $writable;
|
||||
break;
|
||||
default:
|
||||
logger('[ERROR] Conversation::setMode : Unhandled mode ('. $mode .').', LOGGER_DEBUG);
|
||||
|
|
|
@ -15,6 +15,7 @@ use Friendica\Database\DBM;
|
|||
use Friendica\Model\Contact;
|
||||
use Friendica\Model\GContact;
|
||||
use Friendica\Model\Profile;
|
||||
use Friendica\Model\User;
|
||||
use Friendica\Object\Image;
|
||||
use Friendica\Protocol\OStatus;
|
||||
use Friendica\Util\XML;
|
||||
|
@ -341,19 +342,15 @@ class DFRN
|
|||
$items = $r;
|
||||
$item = $r[0];
|
||||
|
||||
$r = q(
|
||||
"SELECT `contact`.*, `user`.`nickname`, `user`.`timezone`, `user`.`page-flags`, `user`.`account-type`
|
||||
FROM `contact` INNER JOIN `user` ON `user`.`uid` = `contact`.`uid`
|
||||
WHERE `contact`.`self` AND `user`.`uid` = %d LIMIT 1",
|
||||
intval($item['uid'])
|
||||
);
|
||||
|
||||
if (!DBM::is_result($r)) {
|
||||
killme();
|
||||
if ($item['uid'] != 0) {
|
||||
$owner = User::getOwnerDataById($item['uid']);
|
||||
if (!$owner) {
|
||||
killme();
|
||||
}
|
||||
else {
|
||||
$owner = ['uid' => 0, 'nick' => '_feed_'];
|
||||
}
|
||||
|
||||
$owner = $r[0];
|
||||
|
||||
$doc = new DOMDocument('1.0', 'utf-8');
|
||||
$doc->formatOutput = true;
|
||||
$type = 'html';
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue