aboutsummaryrefslogtreecommitdiffstats
path: root/Zotlabs
diff options
context:
space:
mode:
authorMario <mario@mariovavti.com>2024-07-22 19:07:19 +0000
committerMario <mario@mariovavti.com>2024-07-22 19:07:19 +0000
commit4e35d342269be73a6d6561b8f7587b5edbb50346 (patch)
treef144ecdae8aefebc0e82b43c7d37b6ac82c536a5 /Zotlabs
parent3708896a658bb7ae8f61377bc85da0bc898a721e (diff)
downloadvolse-hubzilla-4e35d342269be73a6d6561b8f7587b5edbb50346.tar.gz
volse-hubzilla-4e35d342269be73a6d6561b8f7587b5edbb50346.tar.bz2
volse-hubzilla-4e35d342269be73a6d6561b8f7587b5edbb50346.zip
item buttons redesign - initial checkin
Diffstat (limited to 'Zotlabs')
-rw-r--r--Zotlabs/Lib/ThreadItem.php19
-rw-r--r--Zotlabs/Module/Item.php1
-rw-r--r--Zotlabs/Module/Like.php5
-rw-r--r--Zotlabs/Module/Settings/Conversation.php19
4 files changed, 24 insertions, 20 deletions
diff --git a/Zotlabs/Lib/ThreadItem.php b/Zotlabs/Lib/ThreadItem.php
index 1082bf642..960cc82a9 100644
--- a/Zotlabs/Lib/ThreadItem.php
+++ b/Zotlabs/Lib/ThreadItem.php
@@ -129,7 +129,7 @@ class ThreadItem {
if($item['author']['xchan_network'] === 'rss')
$shareable = true;
- $repeatable = ((($conv->get_profile_owner() == local_channel() && local_channel()) && (intval($item['item_private']) === 0) && (in_array($item['author']['xchan_network'], ['zot6', 'activitypub']))) ? true : false);
+ $repeatable = (intval($item['item_private']) === 0 && in_array($item['author']['xchan_network'], ['zot6', 'activitypub']));
// @fixme
// Have recently added code to properly handle polls in group reshares by redirecting all of the poll responses to the group.
@@ -204,9 +204,11 @@ class ThreadItem {
$response_verbs[] = 'dislike';
}
- $response_verbs[] = 'announce';
+ if ($repeatable) {
+ $response_verbs[] = 'announce';
+ }
- if(in_array($item['obj_type'], ['Event', ACTIVITY_OBJ_EVENT])) {
+ if (in_array($item['obj_type'], ['Event', ACTIVITY_OBJ_EVENT])) {
$response_verbs[] = 'attendyes';
$response_verbs[] = 'attendno';
$response_verbs[] = 'attendmaybe';
@@ -216,18 +218,18 @@ class ThreadItem {
}
}
- if($item['obj_type'] === 'Question') {
+ if ($item['obj_type'] === 'Question') {
$response_verbs[] = 'answer';
}
- if(! feature_enabled($conv->get_profile_owner(),'dislike'))
+ if (!feature_enabled($conv->get_profile_owner(),'dislike')) {
unset($conv_responses['dislike']);
+ }
$responses = get_responses($conv_responses,$response_verbs,$this,$item);
$my_responses = [];
foreach($response_verbs as $v) {
-
$my_responses[$v] = ((isset($conv_responses[$v][$item['mid'] . '-m'])) ? 1 : 0);
}
@@ -327,11 +329,13 @@ class ThreadItem {
$like = [];
$dislike = [];
$reply_to = [];
+ $reactions_allowed = false;
if($this->is_commentable() && $observer) {
$like = array( t("I like this \x28toggle\x29"), t("like"));
$dislike = array( t("I don't like this \x28toggle\x29"), t("dislike"));
- $reply_to = array( t("Reply on this comment"), t("reply"), t("Reply to"));
+ $reply_to = array( t("Reply to this comment"), t("reply"), t("Reply to"));
+ $reactions_allowed = true;
}
$share = [];
@@ -539,6 +543,7 @@ class ThreadItem {
'moderate_approve' => t('Approve'),
'moderate_delete' => t('Delete'),
'rtl' => in_array($item['lang'], rtl_languages()),
+ 'reactions_allowed' => $reactions_allowed
);
$arr = array('item' => $item, 'output' => $tmp_item);
diff --git a/Zotlabs/Module/Item.php b/Zotlabs/Module/Item.php
index 3d13655d2..233e0b05a 100644
--- a/Zotlabs/Module/Item.php
+++ b/Zotlabs/Module/Item.php
@@ -1429,7 +1429,6 @@ class Item extends Controller {
require_once('include/items.php');
-
$i = q("select id, uid, item_origin, author_xchan, owner_xchan, source_xchan, item_type from item where id = %d limit 1",
intval(argv(2))
);
diff --git a/Zotlabs/Module/Like.php b/Zotlabs/Module/Like.php
index 4460900a8..d493742e7 100644
--- a/Zotlabs/Module/Like.php
+++ b/Zotlabs/Module/Like.php
@@ -569,6 +569,11 @@ class Like extends Controller {
call_hooks('post_local_end', $arr);
+ if ($is_rsvp && in_array($verb, ['attendyes', 'attendmaybe'])) {
+ event_addtocal($item_id, local_channel());
+ }
+
+
$r = q("select * from item where id = %d",
intval($post_id)
);
diff --git a/Zotlabs/Module/Settings/Conversation.php b/Zotlabs/Module/Settings/Conversation.php
index aa0ff6a7e..5f3d903a8 100644
--- a/Zotlabs/Module/Settings/Conversation.php
+++ b/Zotlabs/Module/Settings/Conversation.php
@@ -11,24 +11,19 @@ class Conversation {
$module = substr(strrchr(strtolower(static::class), '\\'), 1);
check_form_security_token_redirectOnErr('/settings/' . $module, 'settings_' . $module);
-
+
$features = get_module_features($module);
process_module_features_post(local_channel(), $features, $_POST);
-
+
Libsync::build_sync_packet();
-
- if($_POST['aj']) {
- if($_POST['auto_update'] == 1)
- info(t('Settings saved.') . EOL);
- else
- info(t('Settings saved. Reload page please.') . EOL);
+ if($_POST['aj']) {
killme();
}
- else {
- return;
- }
+
+ return;
+
}
function get() {
@@ -48,7 +43,7 @@ class Conversation {
'$features' => process_module_features_get(local_channel(), $features),
'$submit' => t('Submit')
));
-
+
if($aj) {
echo $o;
killme();