aboutsummaryrefslogtreecommitdiffstats
path: root/Zotlabs/Lib
diff options
context:
space:
mode:
authorMario <mario@mariovavti.com>2019-11-22 14:11:26 +0000
committerMario <mario@mariovavti.com>2019-11-22 14:11:26 +0000
commitb62eb665c5ad12ec7bde6bace71a0ddbb6aac28d (patch)
treee7be91535e9bb359a9199c5c28daa74d5242e178 /Zotlabs/Lib
parentc72716eca77d548b457621b004206aa51240464d (diff)
downloadvolse-hubzilla-b62eb665c5ad12ec7bde6bace71a0ddbb6aac28d.tar.gz
volse-hubzilla-b62eb665c5ad12ec7bde6bace71a0ddbb6aac28d.tar.bz2
volse-hubzilla-b62eb665c5ad12ec7bde6bace71a0ddbb6aac28d.zip
sse: store the item mid plus reactions mids in data-mids and change functions accordingly
Diffstat (limited to 'Zotlabs/Lib')
-rw-r--r--Zotlabs/Lib/Enotify.php3
-rw-r--r--Zotlabs/Lib/ThreadItem.php14
2 files changed, 15 insertions, 2 deletions
diff --git a/Zotlabs/Lib/Enotify.php b/Zotlabs/Lib/Enotify.php
index de2bfba24..c1a6c9fdc 100644
--- a/Zotlabs/Lib/Enotify.php
+++ b/Zotlabs/Lib/Enotify.php
@@ -845,7 +845,8 @@ class Enotify {
'photo' => $item[$who]['xchan_photo_s'],
'when' => (($edit) ? datetime_convert('UTC', date_default_timezone_get(), $item['edited']) : datetime_convert('UTC', date_default_timezone_get(), $item['created'])),
'class' => (intval($item['item_unseen']) ? 'notify-unseen' : 'notify-seen'),
- 'b64mid' => ((in_array($item['verb'], [ACTIVITY_LIKE, ACTIVITY_DISLIKE])) ? 'b64.' . base64url_encode($item['thr_parent']) : 'b64.' . base64url_encode($item['mid'])),
+ 'b64mid' => 'b64.' . base64url_encode($item['mid']),
+ //'b64mid' => ((in_array($item['verb'], [ACTIVITY_LIKE, ACTIVITY_DISLIKE])) ? 'b64.' . base64url_encode($item['thr_parent']) : 'b64.' . base64url_encode($item['mid'])),
'notify_id' => 'undefined',
'thread_top' => (($item['item_thread_top']) ? true : false),
'message' => strip_tags(bbcode($itemem_text)),
diff --git a/Zotlabs/Lib/ThreadItem.php b/Zotlabs/Lib/ThreadItem.php
index 174af7f0e..0f59953dc 100644
--- a/Zotlabs/Lib/ThreadItem.php
+++ b/Zotlabs/Lib/ThreadItem.php
@@ -78,7 +78,7 @@ class ThreadItem {
*/
public function get_template_data($conv_responses, $thread_level=1, $conv_flags = []) {
-
+
$result = array();
$item = $this->get_data();
@@ -356,6 +356,17 @@ class ThreadItem {
call_hooks('dropdown_extras',$dropdown_extras_arr);
$dropdown_extras = $dropdown_extras_arr['dropdown_extras'];
+ $mids = ['b64.' . base64url_encode($item['mid'])];
+ $response_mids = [];
+ foreach($response_verbs as $v) {
+ if(isset($conv_responses[$v]['mids'][$item['mid']])) {
+ $response_mids = array_merge($response_mids, $conv_responses[$v]['mids'][$item['mid']]);
+ }
+ }
+
+ $mids = array_merge($mids, $response_mids);
+ $json_mids = json_encode($mids);
+
$tmp_item = array(
'template' => $this->get_template(),
'mode' => $mode,
@@ -370,6 +381,7 @@ class ThreadItem {
'text' => strip_tags($body['html']),
'id' => $this->get_id(),
'mid' => 'b64.' . base64url_encode($item['mid']),
+ 'mids' => $json_mids,
'parent' => $item['parent'],
'author_id' => (($item['author']['xchan_addr']) ? $item['author']['xchan_addr'] : $item['author']['xchan_url']),
'isevent' => $isevent,