aboutsummaryrefslogtreecommitdiffstats
path: root/Zotlabs/Module
diff options
context:
space:
mode:
Diffstat (limited to 'Zotlabs/Module')
-rw-r--r--Zotlabs/Module/Network.php6
-rw-r--r--Zotlabs/Module/Photo.php36
-rw-r--r--Zotlabs/Module/Ping.php2
3 files changed, 27 insertions, 17 deletions
diff --git a/Zotlabs/Module/Network.php b/Zotlabs/Module/Network.php
index 294e11c52..b93faa612 100644
--- a/Zotlabs/Module/Network.php
+++ b/Zotlabs/Module/Network.php
@@ -258,6 +258,10 @@ class Network extends \Zotlabs\Web\Controller {
}
elseif($pf && $unseen && $nouveau) {
+ $vnotify = get_pconfig(local_channel(), 'system', 'vnotify');
+ if(! ($vnotify & VNOTIFY_LIKE))
+ $likes_sql = " AND verb NOT IN ('" . dbesc(ACTIVITY_LIKE) . "', '" . dbesc(ACTIVITY_DISLIKE) . "') ";
+
// This is for nouveau view public forum cid queries (if a forum notification is clicked)
$p = q("SELECT oid AS parent FROM term WHERE uid = %d AND ttype = %d AND term = '%s'",
intval(local_channel()),
@@ -269,7 +273,7 @@ class Network extends \Zotlabs\Web\Controller {
if($p_str)
$p_sql = " OR item.parent IN ( $p_str ) ";
- $sql_extra = " AND ( owner_xchan = '" . protect_sprintf(dbesc($cid_r[0]['abook_xchan'])) . "' OR owner_xchan = '" . protect_sprintf(dbesc($cid_r[0]['abook_xchan'])) . "' $p_sql ) AND item_unseen = 1 ";
+ $sql_extra = " AND ( owner_xchan = '" . protect_sprintf(dbesc($cid_r[0]['abook_xchan'])) . "' OR owner_xchan = '" . protect_sprintf(dbesc($cid_r[0]['abook_xchan'])) . "' $p_sql ) AND item_unseen = 1 $likes_sql ";
}
else {
// This is for threaded view cid queries (e.g. if a forum is selected from the forum filter)
diff --git a/Zotlabs/Module/Photo.php b/Zotlabs/Module/Photo.php
index 8efc00707..d76fca278 100644
--- a/Zotlabs/Module/Photo.php
+++ b/Zotlabs/Module/Photo.php
@@ -33,25 +33,24 @@ class Photo extends \Zotlabs\Web\Controller {
$observer_xchan = get_observer_hash();
- $default = z_root() . '/' . get_default_profile_photo();
-
if(isset($type)) {
/**
* Profile photos - Access controls on default profile photos are not honoured since they need to be exchanged with remote sites.
*
*/
-
+
+ $default = get_default_profile_photo();
+
if($type === 'profile') {
switch($res) {
-
case 'm':
$resolution = 5;
- $default = z_root() . '/' . get_default_profile_photo(80);
+ $default = get_default_profile_photo(80);
break;
case 's':
$resolution = 6;
- $default = z_root() . '/' . get_default_profile_photo(48);
+ $default = get_default_profile_photo(48);
break;
case 'l':
default:
@@ -60,6 +59,8 @@ class Photo extends \Zotlabs\Web\Controller {
}
}
+ $modified = filemtime($default);
+ $default = z_root() . '/' . $default;
$uid = $person;
$d = [ 'imgscale' => $resolution, 'channel_id' => $uid, 'default' => $default, 'data' => '', 'mimetype' => '' ];
@@ -78,6 +79,7 @@ class Photo extends \Zotlabs\Web\Controller {
intval(PHOTO_PROFILE)
);
if($r) {
+ $modified = strtotime($r[0]['edited']);
$data = dbunescbin($r[0]['content']);
$mimetype = $r[0]['mimetype'];
}
@@ -164,9 +166,9 @@ class Photo extends \Zotlabs\Web\Controller {
if($exists && $allowed) {
$data = dbunescbin($e[0]['content']);
$mimetype = $e[0]['mimetype'];
- if(intval($e[0]['os_storage'])) {
+ $modified = strtotime($e[0]['edited']);
+ if(intval($e[0]['os_storage']))
$streaming = $data;
- }
}
else {
if(! $allowed) {
@@ -183,7 +185,6 @@ class Photo extends \Zotlabs\Web\Controller {
if(! isset($data)) {
if(isset($resolution)) {
switch($resolution) {
-
case 4:
$data = fetch_image_from_url(z_root() . '/' . get_default_profile_photo(),$mimetype);
break;
@@ -210,10 +211,14 @@ class Photo extends \Zotlabs\Web\Controller {
}
}
+ // @FIXME Seems never invoked
// Writing in cachefile
- if (isset($cachefile) && $cachefile != '')
+ if (isset($cachefile) && $cachefile != '') {
file_put_contents($cachefile, $data);
-
+ $modified = filemtime($cachefile);
+ }
+
+
if(function_exists('header_remove')) {
header_remove('Pragma');
header_remove('pragma');
@@ -240,15 +245,16 @@ class Photo extends \Zotlabs\Web\Controller {
// This has performance considerations but we highly recommend you
// leave it alone.
- $cache = get_config('system','photo_cache_time');
- if(! $cache)
- $cache = (3600 * 24); // 1 day
-
+ $cache = get_config('system','photo_cache_time', 86400); // 1 day by default
+
header("Expires: " . gmdate("D, d M Y H:i:s", time() + $cache) . " GMT");
header("Cache-Control: max-age=" . $cache);
}
+ header("Last-Modified: " . gmdate("D, d M Y H:i:s", $modified) . " GMT");
+ header("Content-Length: " . strlen($data));
+
// If it's a file resource, stream it.
if($streaming && $channel) {
diff --git a/Zotlabs/Module/Ping.php b/Zotlabs/Module/Ping.php
index cf5b2e004..f660c3b55 100644
--- a/Zotlabs/Module/Ping.php
+++ b/Zotlabs/Module/Ping.php
@@ -650,7 +650,7 @@ class Ping extends \Zotlabs\Web\Controller {
$p_sql = (($p_str) ? "OR parent IN ( $p_str )" : '');
$r = q("select count(id) as unseen from item
- where uid = %d and ( owner_xchan = '%s' OR author_xchan = '%s' $p_sql ) and item_unseen = 1 $item_normal",
+ where uid = %d and ( owner_xchan = '%s' OR author_xchan = '%s' $p_sql ) and item_unseen = 1 $item_normal $sql_extra",
intval(local_channel()),
dbesc($forums[$x]['xchan_hash']),
dbesc($forums[$x]['xchan_hash'])