diff options
Diffstat (limited to 'Zotlabs')
-rw-r--r-- | Zotlabs/Lib/Enotify.php | 16 | ||||
-rw-r--r-- | Zotlabs/Lib/ThreadItem.php | 14 | ||||
-rw-r--r-- | Zotlabs/Module/Connections.php | 23 | ||||
-rw-r--r-- | Zotlabs/Module/Display.php | 3 | ||||
-rw-r--r-- | Zotlabs/Module/Hq.php | 4 | ||||
-rw-r--r-- | Zotlabs/Module/Viewconnections.php | 24 | ||||
-rw-r--r-- | Zotlabs/Web/WebServer.php | 8 |
7 files changed, 67 insertions, 25 deletions
diff --git a/Zotlabs/Lib/Enotify.php b/Zotlabs/Lib/Enotify.php index de2bfba24..bc2710ee1 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)), @@ -871,19 +872,8 @@ class Enotify { $message = substr($message, strlen($tt['xname']) + 1); $mid = basename($tt['link']); - $mid = ((strpos($mid, 'b64.') === 0) ? @base64url_decode(substr($mid, 4)) : $mid); - if(in_array($tt['verb'], [ACTIVITY_LIKE, ACTIVITY_DISLIKE])) { - // we need the thread parent - $r = q("select thr_parent from item where mid = '%s' and uid = %d limit 1", - dbesc($mid), - intval(local_channel()) - ); - $b64mid = ((strpos($r[0]['thr_parent'], 'b64.') === 0) ? $r[0]['thr_parent'] : 'b64.' . base64url_encode($r[0]['thr_parent'])); - } - else { - $b64mid = ((strpos($mid, 'b64.') === 0) ? $mid : 'b64.' . base64url_encode($mid)); - } + $b64mid = ((strpos($mid, 'b64.') === 0) ? $mid : 'b64.' . base64url_encode($mid)); $x = [ 'notify_link' => z_root() . '/notify/view/' . $tt['id'], 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, diff --git a/Zotlabs/Module/Connections.php b/Zotlabs/Module/Connections.php index f6133d5f8..029601867 100644 --- a/Zotlabs/Module/Connections.php +++ b/Zotlabs/Module/Connections.php @@ -283,6 +283,28 @@ class Connections extends \Zotlabs\Web\Controller { if(! intval(get_abconfig(local_channel(),$rr['xchan_hash'],'their_perms','post_comments'))) { $oneway = true; } + + $perminfo['connpermcount']=0; + $perminfo['connperms']=t('Accepts').': '; + if(intval(get_abconfig(local_channel(),$rr['xchan_hash'],'their_perms','post_comments'))) { + $perminfo['connpermcount']++; + $perminfo['connperms'] .= t('Comments'); + } + if(intval(get_abconfig(local_channel(),$rr['xchan_hash'],'their_perms','send_stream'))) { + $perminfo['connpermcount']++; + $perminfo['connperms'] = ($perminfo['connperms']) ? $perminfo['connperms'] . ', ' : $perminfo['connperms'] ; + $perminfo['connperms'] .= t('Stream items'); + } + if(intval(get_abconfig(local_channel(),$rr['xchan_hash'],'their_perms','post_wall'))) { + $perminfo['connpermcount']++; + $perminfo['connperms'] = ($perminfo['connperms']) ? $perminfo['connperms'] . ', ' : $perminfo['connperms'] ; + $perminfo['connperms'] .= t('Wall posts'); + } + + if ($perminfo['connpermcount'] == 0) { + $perminfo['connperms'] .= t('Nothing'); + } + foreach($status as $str) { if(!$str) @@ -323,6 +345,7 @@ class Connections extends \Zotlabs\Web\Controller { 'recent_label' => t('Recent activity'), 'recentlink' => z_root() . '/network/?f=&cid=' . intval($rr['abook_id']) . '&name=' . $rr['xchan_name'], 'oneway' => $oneway, + 'perminfo' => $perminfo, 'connect' => (intval($rr['abook_not_here']) ? t('Connect') : ''), 'follow' => z_root() . '/follow/?f=&url=' . urlencode($rr['xchan_hash']) . '&interactive=0', 'connect_hover' => t('Connect at this location') diff --git a/Zotlabs/Module/Display.php b/Zotlabs/Module/Display.php index 5983578b3..cf38aba1a 100644 --- a/Zotlabs/Module/Display.php +++ b/Zotlabs/Module/Display.php @@ -200,7 +200,8 @@ class Display extends \Zotlabs\Web\Controller { // if the target item is not a post (eg a like) we want to address its thread parent - $mid = ((($target_item['verb'] == ACTIVITY_LIKE) || ($target_item['verb'] == ACTIVITY_DISLIKE)) ? $target_item['thr_parent'] : $target_item['mid']); + //$mid = ((($target_item['verb'] == ACTIVITY_LIKE) || ($target_item['verb'] == ACTIVITY_DISLIKE)) ? $target_item['thr_parent'] : $target_item['mid']); + $mid = $target_item['mid']; // if we got a decoded hash we must encode it again before handing to javascript if($decoded) diff --git a/Zotlabs/Module/Hq.php b/Zotlabs/Module/Hq.php index 848fe3e25..d8c540fb9 100644 --- a/Zotlabs/Module/Hq.php +++ b/Zotlabs/Module/Hq.php @@ -152,8 +152,8 @@ class Hq extends \Zotlabs\Web\Controller { if($target_item) { // if the target item is not a post (eg a like) we want to address its thread parent - $mid = ((($target_item['verb'] == ACTIVITY_LIKE) || ($target_item['verb'] == ACTIVITY_DISLIKE)) ? $target_item['thr_parent'] : $target_item['mid']); - + //$mid = ((($target_item['verb'] == ACTIVITY_LIKE) || ($target_item['verb'] == ACTIVITY_DISLIKE)) ? $target_item['thr_parent'] : $target_item['mid']); + $mid = $target_item['mid']; // if we got a decoded hash we must encode it again before handing to javascript if($decoded) $mid = 'b64.' . base64url_encode($mid); diff --git a/Zotlabs/Module/Viewconnections.php b/Zotlabs/Module/Viewconnections.php index 30df0b9e4..320a331d1 100644 --- a/Zotlabs/Module/Viewconnections.php +++ b/Zotlabs/Module/Viewconnections.php @@ -74,6 +74,29 @@ class Viewconnections extends \Zotlabs\Web\Controller { if(! intval(get_abconfig(\App::$profile['uid'],$rr['xchan_hash'],'their_perms','post_comments'))) { $oneway = true; } + + $perminfo=[]; + $perminfo['connpermcount']=0; + $perminfo['connperms']=t('Accepts').': '; + if(intval(get_abconfig(\App::$profile['uid'],$rr['xchan_hash'],'their_perms','post_comments'))) { + $perminfo['connpermcount']++; + $perminfo['connperms'] .= t('Comments'); + } + if(intval(get_abconfig(\App::$profile['uid'],$rr['xchan_hash'],'their_perms','send_stream'))) { + $perminfo['connpermcount']++; + $perminfo['connperms'] = ($perminfo['connperms']) ? $perminfo['connperms'] . ', ' : $perminfo['connperms'] ; + $perminfo['connperms'] .= t('Stream items'); + } + if(intval(get_abconfig(\App::$profile['uid'],$rr['xchan_hash'],'their_perms','post_wall'))) { + $perminfo['connpermcount']++; + $perminfo['connperms'] = ($perminfo['connperms']) ? $perminfo['connperms'] . ', ' : $perminfo['connperms'] ; + $perminfo['connperms'] .= t('Wall posts'); + } + + if ($perminfo['connpermcount'] == 0) { + $perminfo['connperms'] .= t('Nothing'); + } + $url = chanlink_hash($rr['xchan_hash']); if($url) { @@ -88,6 +111,7 @@ class Viewconnections extends \Zotlabs\Web\Controller { 'sparkle' => '', 'itemurl' => $rr['url'], 'network' => '', + 'perminfo' => $perminfo, 'oneway' => $oneway ); } diff --git a/Zotlabs/Web/WebServer.php b/Zotlabs/Web/WebServer.php index 1c3ea29d0..909823ec4 100644 --- a/Zotlabs/Web/WebServer.php +++ b/Zotlabs/Web/WebServer.php @@ -82,14 +82,6 @@ class WebServer { if((x($_SESSION, 'authenticated')) || (x($_POST, 'auth-params')) || (\App::$module === 'login')) require('include/auth.php'); - if(! x($_SESSION, 'sysmsg')) - $_SESSION['sysmsg'] = array(); - - if(! x($_SESSION, 'sysmsg_info')) - $_SESSION['sysmsg_info'] = array(); - - - if(\App::$install) { /* Allow an exception for the view module so that pcss will be interpreted during installation */ if(\App::$module != 'view') |