mirror of
https://github.com/friendica/friendica
synced 2025-04-26 05:10:11 +00:00
Issue 13714: Support for "commentsEnabled" and "capabilities"
This commit is contained in:
parent
732d738b82
commit
7a0c5d141e
9 changed files with 75 additions and 13 deletions
|
@ -212,12 +212,25 @@ class Post
|
|||
$shareable = in_array($conv->getProfileOwner(), [0, DI::userSession()->getLocalUserId()]) && $item['private'] != Item::PRIVATE;
|
||||
$announceable = $shareable && in_array($item['network'], [Protocol::ACTIVITYPUB, Protocol::DFRN, Protocol::DIASPORA, Protocol::TWITTER, Protocol::TUMBLR, Protocol::BLUESKY]);
|
||||
$commentable = ($item['network'] != Protocol::TUMBLR);
|
||||
$likeable = true;
|
||||
|
||||
// On Diaspora only toplevel posts can be reshared
|
||||
if ($announceable && ($item['network'] == Protocol::DIASPORA) && ($item['gravity'] != Item::GRAVITY_PARENT)) {
|
||||
$announceable = false;
|
||||
}
|
||||
|
||||
if ($item['restrictions'] & Item::CANT_REPLY) {
|
||||
$commentable = false;
|
||||
}
|
||||
|
||||
if ($item['restrictions'] & Item::CANT_LIKE) {
|
||||
$likeable = false;
|
||||
}
|
||||
|
||||
if ($item['restrictions'] & Item::CANT_ANNOUNCE) {
|
||||
$announceable = false;
|
||||
}
|
||||
|
||||
$edpost = false;
|
||||
|
||||
if (DI::userSession()->getLocalUserId()) {
|
||||
|
@ -423,8 +436,10 @@ class Post
|
|||
}
|
||||
|
||||
if ($conv->isWritable()) {
|
||||
$buttons['like'] = [DI::l10n()->t("I like this \x28toggle\x29"), DI::l10n()->t('Like')];
|
||||
$buttons['dislike'] = [DI::l10n()->t("I don't like this \x28toggle\x29"), DI::l10n()->t('Dislike')];
|
||||
if ($likeable) {
|
||||
$buttons['like'] = [DI::l10n()->t("I like this \x28toggle\x29"), DI::l10n()->t('Like')];
|
||||
$buttons['dislike'] = [DI::l10n()->t("I don't like this \x28toggle\x29"), DI::l10n()->t('Dislike')];
|
||||
}
|
||||
if ($shareable) {
|
||||
$buttons['share'] = [DI::l10n()->t('Quote share this'), DI::l10n()->t('Quote Share')];
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue