aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMario Vavti <mario@mariovavti.com>2017-07-11 16:11:52 +0200
committerMario Vavti <mario@mariovavti.com>2017-07-11 16:11:52 +0200
commit403e90861cccecc3179e380b084238e1294fe61e (patch)
treea14f7f3710f729fb91bc2242781cc7b2623b68aa
parent271ed82d0def7b658f074ada9adb1aaa51bdd507 (diff)
parent2d63bbb91e97d3a54440564620ef3093ecbe71fb (diff)
downloadvolse-hubzilla-403e90861cccecc3179e380b084238e1294fe61e.tar.gz
volse-hubzilla-403e90861cccecc3179e380b084238e1294fe61e.tar.bz2
volse-hubzilla-403e90861cccecc3179e380b084238e1294fe61e.zip
Merge red/master
-rw-r--r--Zotlabs/Module/Item.php9
-rw-r--r--Zotlabs/Module/Like.php5
-rw-r--r--Zotlabs/Module/React.php4
-rw-r--r--Zotlabs/Module/Settings/Featured.php18
-rw-r--r--Zotlabs/Zot/Auth.php2
-rw-r--r--include/feedutils.php4
-rw-r--r--include/import.php8
-rwxr-xr-xinclude/items.php2
-rwxr-xr-xinclude/oembed.php6
-rw-r--r--include/zid.php2
-rw-r--r--include/zot.php12
11 files changed, 56 insertions, 16 deletions
diff --git a/Zotlabs/Module/Item.php b/Zotlabs/Module/Item.php
index e96d4c669..9e64528fa 100644
--- a/Zotlabs/Module/Item.php
+++ b/Zotlabs/Module/Item.php
@@ -861,8 +861,8 @@ class Item extends \Zotlabs\Web\Controller {
}
- if(mb_strlen($datarray['title']) > 255)
- $datarray['title'] = mb_substr($datarray['title'],0,255);
+ if(mb_strlen($datarray['title']) > 191)
+ $datarray['title'] = mb_substr($datarray['title'],0,191);
if($webpage) {
Zlib\IConfig::Set($datarray,'system', webpage_to_namespace($webpage),
@@ -928,6 +928,11 @@ class Item extends \Zotlabs\Web\Controller {
if($parent) {
+ // prevent conversations which you are involved from being expired
+
+ if(local_channel())
+ retain_item($parent);
+
// only send comment notification if this is a wall-to-wall comment,
// otherwise it will happen during delivery
diff --git a/Zotlabs/Module/Like.php b/Zotlabs/Module/Like.php
index 71336e8f3..c995079ce 100644
--- a/Zotlabs/Module/Like.php
+++ b/Zotlabs/Module/Like.php
@@ -504,6 +504,11 @@ class Like extends \Zotlabs\Web\Controller {
$post = item_store($arr);
$post_id = $post['item_id'];
+
+ // save the conversation from expiration
+
+ if(local_channel() && array_key_exists('item',$post) && (intval($post['item']['id']) != intval($post['item']['parent'])))
+ retain_item($post['item']['parent']);
$arr['id'] = $post_id;
diff --git a/Zotlabs/Module/React.php b/Zotlabs/Module/React.php
index ed4f87e7e..6cd79c952 100644
--- a/Zotlabs/Module/React.php
+++ b/Zotlabs/Module/React.php
@@ -39,6 +39,10 @@ class React extends \Zotlabs\Web\Controller {
$n['author_xchan'] = $channel['channel_hash'];
$x = item_store($n);
+
+ if(local_channel())
+ retain_item($postid);
+
if($x['success']) {
$nid = $x['item_id'];
\Zotlabs\Daemon\Master::Summon(array('Notifier','like',$nid));
diff --git a/Zotlabs/Module/Settings/Featured.php b/Zotlabs/Module/Settings/Featured.php
index 4885abd1d..ebe2996d3 100644
--- a/Zotlabs/Module/Settings/Featured.php
+++ b/Zotlabs/Module/Settings/Featured.php
@@ -10,14 +10,16 @@ class Featured {
call_hooks('feature_settings_post', $_POST);
- if(intval($_POST['affinity_cmax'])) {
- set_pconfig(local_channel(),'affinity','cmax',intval($_POST['affinity_cmax']));
- }
- if(intval($_POST['affinity_cmin'])) {
- set_pconfig(local_channel(),'affinity','cmin',intval($_POST['affinity_cmin']));
- }
- if(intval($_POST['affinity_cmax']) || intval($_POST['affinity_cmin'])) {
- info( t('Affinity Slider settings updated.') . EOL);
+ if($_POST['affinity_slider-submit']) {
+ if(intval($_POST['affinity_cmax'])) {
+ set_pconfig(local_channel(),'affinity','cmax',intval($_POST['affinity_cmax']));
+ }
+ if(intval($_POST['affinity_cmin'])) {
+ set_pconfig(local_channel(),'affinity','cmin',intval($_POST['affinity_cmin']));
+ }
+ if(intval($_POST['affinity_cmax']) || intval($_POST['affinity_cmin'])) {
+ info( t('Affinity Slider settings updated.') . EOL);
+ }
}
build_sync_packet();
diff --git a/Zotlabs/Zot/Auth.php b/Zotlabs/Zot/Auth.php
index d4d3bee1d..92b0fff78 100644
--- a/Zotlabs/Zot/Auth.php
+++ b/Zotlabs/Zot/Auth.php
@@ -176,7 +176,7 @@ class Auth {
return false;
}
- $this->Debug('auth check request returned .' . print_r($j, true));
+ $this->Debug('auth check request returned ' . print_r($j, true));
if(! $j['success'])
return false;
diff --git a/include/feedutils.php b/include/feedutils.php
index d96735c3a..8696cc867 100644
--- a/include/feedutils.php
+++ b/include/feedutils.php
@@ -1009,6 +1009,8 @@ function consume_feed($xml, $importer, &$contact, $pass = 0) {
$parent_link = $rawthread[0]['attribs']['']['href'];
}
+ logger('in-reply-to: ' . $parent_mid, LOGGER_DEBUG);
+
if($is_reply) {
if($pass == 1)
@@ -1088,6 +1090,7 @@ function consume_feed($xml, $importer, &$contact, $pass = 0) {
intval($importer['channel_id'])
);
if($c) {
+ logger('find_parent: matched conversation: ' . $conv_id, LOGGER_DEBUG);
$pmid = $c[0]['parent_mid'];
$datarray['parent_mid'] = $pmid;
}
@@ -1099,6 +1102,7 @@ function consume_feed($xml, $importer, &$contact, $pass = 0) {
);
if($x) {
+ logger('find_parent: matched in-reply-to: ' . $parent_mid, LOGGER_DEBUG);
$pmid = $x[0]['parent_mid'];
$datarray['parent_mid'] = $pmid;
}
diff --git a/include/import.php b/include/import.php
index 277d6618c..2199400af 100644
--- a/include/import.php
+++ b/include/import.php
@@ -627,6 +627,14 @@ function import_items($channel, $items, $sync = false, $relocate = null) {
$item_result = item_store($item,$allow_code,$deliver);
}
+ // preserve conversations you've been involved in from being expired
+
+ $stored = $item_result['item'];
+ if((is_array($stored)) && ($stored['id'] != $stored['parent'])
+ && ($stored['author_xchan'] === $channel['channel_hash'])) {
+ retain_item($stored['item']['parent']);
+ }
+
fix_attached_photo_permissions($channel['channel_id'],$item['author_xchan'],$item['body'],$item['allow_cid'],$item['allow_gid'],$item['deny_cid'],$item['deny_gid']);
fix_attached_file_permissions($channel,$item['author_xchan'],$item['body'],$item['allow_cid'],$item['allow_gid'],$item['deny_cid'],$item['deny_gid']);
diff --git a/include/items.php b/include/items.php
index b313193fb..386c25922 100755
--- a/include/items.php
+++ b/include/items.php
@@ -1737,7 +1737,7 @@ logger('revision: ' . $arr['revision']);
if($r[0]['owner_xchan'] !== $arr['owner_xchan']) {
$arr['owner_xchan'] = $r[0]['owner_xchan'];
-// $uplinked_comment = true;
+ // $uplinked_comment = true;
}
// if the parent is private, force privacy for the entire conversation
diff --git a/include/oembed.php b/include/oembed.php
index e35a77fa3..460e0244e 100755
--- a/include/oembed.php
+++ b/include/oembed.php
@@ -134,7 +134,9 @@ function oembed_fetch_url($embedurl){
$txt = null;
// we should try to cache this and avoid a lookup on each render
- $zrl = ((get_config('system','oembed_zrl')) ? is_matrix_url($embedurl) : false);
+ $is_matrix = is_matrix_url($embedurl);
+
+ $zrl = ((get_config('system','oembed_zrl')) ? $is_matrix : false);
$furl = ((local_channel() && $zrl) ? zid($embedurl) : $embedurl);
@@ -222,7 +224,7 @@ function oembed_fetch_url($embedurl){
if($action === 'filter') {
if($j['html']) {
$orig = $j['html'];
- $allow_position = (($zrl) ? true : false);
+ $allow_position = (($is_matrix) ? true : false);
$j['html'] = purify_html($j['html'],$allow_position);
if($j['html'] != $orig) {
logger('oembed html was purified. original: ' . $orig . ' purified: ' . $j['html'], LOGGER_DEBUG, LOG_INFO);
diff --git a/include/zid.php b/include/zid.php
index f5df1c611..ee43fd7c8 100644
--- a/include/zid.php
+++ b/include/zid.php
@@ -60,7 +60,7 @@ function zid($s,$address = '') {
/**
* @FIXME checking against our own channel url is no longer reliable. We may have a lot
- * of urls attached to out channel. Should probably match against our site, since we
+ * of urls attached to our channel. Should probably match against our site, since we
* will not need to remote authenticate on our own site anyway.
*/
diff --git a/include/zot.php b/include/zot.php
index a8aecc6fa..05475d051 100644
--- a/include/zot.php
+++ b/include/zot.php
@@ -1761,7 +1761,7 @@ function process_delivery($sender, $arr, $deliveries, $relay, $public = false, $
$result[] = $DR->get();
}
else {
- update_imported_item($sender,$arr,$r[0],$channel['channel_id'],$tag_delivery);
+ $item_result = update_imported_item($sender,$arr,$r[0],$channel['channel_id'],$tag_delivery);
$DR->update('updated');
$result[] = $DR->get();
if(! $relay)
@@ -1810,6 +1810,14 @@ function process_delivery($sender, $arr, $deliveries, $relay, $public = false, $
}
}
+ // preserve conversations with which you are involved from expiration
+
+ $stored = (($item_result && $item_result['item']) ? $item_result['item'] : false);
+ if((is_array($stored)) && ($stored['id'] != $stored['parent'])
+ && ($stored['author_xchan'] === $channel['channel_hash'])) {
+ retain_item($stored['item']['parent']);
+ }
+
if($relay && $item_id) {
logger('process_delivery: invoking relay');
Zotlabs\Daemon\Master::Summon(array('Notifier','relay',intval($item_id)));
@@ -1946,6 +1954,8 @@ function update_imported_item($sender, $item, $orig, $uid, $tag_delivery) {
logger('update_imported_item: failed: ' . $x['message']);
else
logger('update_imported_item');
+
+ return $x;
}
/**