From 0596097f8603d24823ea57a68eaf405c6c0d94ff Mon Sep 17 00:00:00 2001 From: friendica Date: Mon, 26 Jan 2015 19:13:06 -0800 Subject: provide storage for directory based reputation in the xlink table by setting xlink_static = 1, so that xlink_static = 0 is traditional poco linkages --- include/onepoll.php | 2 +- include/poller.php | 2 +- include/socgraph.php | 14 ++++++++------ 3 files changed, 10 insertions(+), 8 deletions(-) (limited to 'include') diff --git a/include/onepoll.php b/include/onepoll.php index 095edd095..ee90fbdb1 100644 --- a/include/onepoll.php +++ b/include/onepoll.php @@ -145,7 +145,7 @@ function onepoll_run($argv, $argc){ if($contact['xchan_connurl']) { $r = q("SELECT xlink_id from xlink - where xlink_xchan = '%s' and xlink_updated > %s - INTERVAL %s limit 1", + where xlink_xchan = '%s' and xlink_updated > %s - INTERVAL %s and xlink_static = 0 limit 1", intval($contact['xchan_hash']), db_utcnow(), db_quoteinterval('1 DAY') ); diff --git a/include/poller.php b/include/poller.php index d78355db1..dc310fe16 100644 --- a/include/poller.php +++ b/include/poller.php @@ -160,7 +160,7 @@ function poller_run($argv, $argc){ // get rid of really old poco records - q("delete from xlink where xlink_updated < %s - INTERVAL %s", + q("delete from xlink where xlink_updated < %s - INTERVAL %s and xlink_static = 0 ", db_utcnow(), db_quoteinterval('14 DAY') ); diff --git a/include/socgraph.php b/include/socgraph.php index 8c2056c30..542ec7074 100644 --- a/include/socgraph.php +++ b/include/socgraph.php @@ -186,13 +186,13 @@ function poco_load($xchan = '',$url = null) { $total ++; - $r = q("select * from xlink where xlink_xchan = '%s' and xlink_link = '%s' limit 1", + $r = q("select * from xlink where xlink_xchan = '%s' and xlink_link = '%s' and xlink_static = 0 limit 1", dbesc($xchan), dbesc($hash) ); if(! $r) { - q("insert into xlink ( xlink_xchan, xlink_link, xlink_rating, xlink_rating_text, xlink_updated ) values ( '%s', '%s', %d, '%s', '%s' ) ", + q("insert into xlink ( xlink_xchan, xlink_link, xlink_rating, xlink_rating_text, xlink_updated, xlink_static ) values ( '%s', '%s', %d, '%s', '%s', 0 ) ", dbesc($xchan), dbesc($hash), intval($rating), @@ -211,7 +211,7 @@ function poco_load($xchan = '',$url = null) { } logger("poco_load: loaded $total entries",LOGGER_DEBUG); - q("delete from xlink where xlink_xchan = '%s' and xlink_updated < %s - INTERVAL %s", + q("delete from xlink where xlink_xchan = '%s' and xlink_updated < %s - INTERVAL %s and xlink_static = 0", dbesc($xchan), db_utcnow(), db_quoteinterval('2 DAY') ); @@ -222,7 +222,7 @@ function poco_load($xchan = '',$url = null) { function count_common_friends($uid,$xchan) { - $r = q("SELECT count(xlink_id) as total from xlink where xlink_xchan = '%s' and xlink_link in + $r = q("SELECT count(xlink_id) as total from xlink where xlink_xchan = '%s' and xlink_static = 0 and xlink_link in (select abook_xchan from abook where abook_xchan != '%s' and abook_channel = %d and abook_flags = 0 )", dbesc($xchan), dbesc($xchan), @@ -243,7 +243,7 @@ function common_friends($uid,$xchan,$start = 0,$limit=100000000,$shuffle = false else $sql_extra = " order by xchan_name asc "; - $r = q("SELECT * from xchan left join xlink on xlink_link = xchan_hash where xlink_xchan = '%s' and xlink_link in + $r = q("SELECT * from xchan left join xlink on xlink_link = xchan_hash where xlink_xchan = '%s' and xlink_static = 0 and xlink_link in (select abook_xchan from abook where abook_xchan != '%s' and abook_channel = %d and abook_flags = 0 ) $sql_extra limit %d offset %d", dbesc($xchan), dbesc($xchan), @@ -340,6 +340,7 @@ function suggestion_query($uid, $myxchan, $start = 0, $limit = 80) { and not xlink_link in ( select abook_xchan from abook where abook_channel = %d ) and not xlink_link in ( select xchan from xign where uid = %d ) and xlink_xchan != '' + and xlink_static = 0 and not ( xchan_flags & %d )>0 and not ( xchan_flags & %d )>0 group by xchan_hash order by total desc limit %d offset %d ", @@ -360,6 +361,7 @@ function suggestion_query($uid, $myxchan, $start = 0, $limit = 80) { where xlink_xchan = '' and not xlink_link in ( select abook_xchan from abook where abook_channel = %d ) and not xlink_link in ( select xchan from xign where uid = %d ) + and xlink_static = 0 and not ( xchan_flags & %d )>0 and not ( xchan_flags & %d )>0 group by xchan_hash order by total desc limit %d offset %d ", @@ -405,7 +407,7 @@ function update_suggestions() { // the targets may have changed their preferences and don't want to be suggested - and they // may have simply gone away. - $r = q("delete from xlink where xlink_xchan = '' and xlink_updated < %s - INTERVAL %s", + $r = q("delete from xlink where xlink_xchan = '' and xlink_updated < %s - INTERVAL %s and xlink_static = 0", db_utcnow(), db_quoteinterval('7 DAY') ); -- cgit v1.2.3 From fc62d7e5775f57949b300eb658f57187446ce381 Mon Sep 17 00:00:00 2001 From: friendica Date: Mon, 26 Jan 2015 19:43:39 -0800 Subject: handle an incoming directory rating message --- include/zot.php | 47 +++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 45 insertions(+), 2 deletions(-) (limited to 'include') diff --git a/include/zot.php b/include/zot.php index 780c6a265..bedc0c1b5 100644 --- a/include/zot.php +++ b/include/zot.php @@ -1096,6 +1096,12 @@ function zot_import($arr, $sender_url) { $i['notify']['sender']['hash'] = make_xchan_hash($i['notify']['sender']['guid'],$i['notify']['sender']['guid_sig']); $deliveries = null; + if(array_key_exists('message',$i) && array_key_exists('type',$i['message']) && $i['message']['type'] === 'rating') { + // rating messages are processed only by directory servers + logger('Rating received: ' . print_r($arr,true), LOGGER_DATA); + $result = process_rating_delivery($i['notify']['sender'],$arr); + } + if(array_key_exists('recipients',$i['notify']) && count($i['notify']['recipients'])) { logger('specific recipients'); $recip_arr = array(); @@ -1115,7 +1121,8 @@ function zot_import($arr, $sender_url) { // It's a specifically targetted post. If we were sent a public_scope hint (likely), // get rid of it so that it doesn't get stored and cause trouble. - if(($i) && is_array($i) && array_key_exists('message',$i) && is_array($i['message']) && array_key_exists('public_scope',$i['message'])) + if(($i) && is_array($i) && array_key_exists('message',$i) && is_array($i['message']) + && $i['message']['type'] === 'activity' && array_key_exists('public_scope',$i['message'])) unset($i['message']['public_scope']); $deliveries = $r; @@ -1124,7 +1131,7 @@ function zot_import($arr, $sender_url) { } else { - if(($i['message']) && (array_key_exists('flags',$i['message'])) && (in_array('private',$i['message']['flags']))) { + if(($i['message']) && (array_key_exists('flags',$i['message'])) && (in_array('private',$i['message']['flags'])) && $i['message']['type'] === 'activity') { if(array_key_exists('public_scope',$i['message']) && $i['message']['public_scope'] === 'public') { // This should not happen but until we can stop it... logger('private message was delivered with no recipients.'); @@ -1215,6 +1222,7 @@ function zot_import($arr, $sender_url) { $result = process_profile_delivery($i['notify']['sender'],$arr,$deliveries); } + elseif($i['message']['type'] === 'channel_sync') { // $arr = get_channelsync_elements($i['message']); @@ -1771,6 +1779,41 @@ function process_mail_delivery($sender,$arr,$deliveries) { return $result; } +function process_rating_delivery($sender,$arr) { + + $dirmode = intval(get_config('system','directory_mode')); + if($dirmode == DIRECTORY_MODE_NORMAL) + return; + + if(! $arr['target']) + return; + + $r = q("select * from xlink where xlink_xchan = '%s' and xlink_target = '%s' limit 1", + dbesc($sender['hash']), + dbesc($arr['target']) + ); + if($r) { + $x = q("update xlink set xlink_rating = %d, xlink_rating_text = '%s', xlink_updated = '%s' where xlink_id = %d", + intval($arr['rating']), + intval($arr['rating_text']), + dbesc(datetime_convert()), + intval($r[0]['xlink_id']) + ); + } + else { + $x = q("insert into xlink ( xlink_xchan, xlink_link, xlink_rating, xlink_rating_text, xlink_updated, xlink_static ) + values( '%s', '%s', %d, '%s', '%s', 1 ) ", + dbesc($sender['hash']), + dbesc($arr['target']), + intval($arr['rating']), + intval($arr['rating_text']), + dbesc(datetime_convert()) + ); + } + return; +} + + function process_profile_delivery($sender,$arr,$deliveries) { logger('process_profile_delivery', LOGGER_DEBUG); -- cgit v1.2.3 From efb6842d748ad35f2843619983a4e3e9b14617a9 Mon Sep 17 00:00:00 2001 From: friendica Date: Mon, 26 Jan 2015 20:47:53 -0800 Subject: superblock enhancements --- include/enotify.php | 1 + 1 file changed, 1 insertion(+) (limited to 'include') diff --git a/include/enotify.php b/include/enotify.php index 6fc771c58..36d457c10 100644 --- a/include/enotify.php +++ b/include/enotify.php @@ -333,6 +333,7 @@ function notification($params) { $datarray = array(); $datarray['hash'] = $hash; + $datarray['sender_hash'] = $sender['xchan_hash']; $datarray['name'] = $sender['xchan_name']; $datarray['url'] = $sender['xchan_url']; $datarray['photo'] = $sender['xchan_photo_s']; -- cgit v1.2.3 From 65aa6cf708a34e20ebad3c6b6dfc4088e927cce1 Mon Sep 17 00:00:00 2001 From: marijus Date: Tue, 27 Jan 2015 19:00:16 +0100 Subject: move userReadableSize() and getIconFromType() from /include/RedDAV/RedBrowser.php to include/text.php and add template for mod/sharedwithme --- include/RedDAV/RedBrowser.php | 95 ++++--------------------------------------- include/text.php | 71 ++++++++++++++++++++++++++++++++ 2 files changed, 78 insertions(+), 88 deletions(-) (limited to 'include') diff --git a/include/RedDAV/RedBrowser.php b/include/RedDAV/RedBrowser.php index 5642c3f86..e893d6ebd 100644 --- a/include/RedDAV/RedBrowser.php +++ b/include/RedDAV/RedBrowser.php @@ -82,7 +82,7 @@ class RedBrowser extends DAV\Browser\Plugin { date_default_timezone_set($this->auth->getTimezone()); require_once('include/conversation.php'); - + require_once('include/text.php'); if ($this->auth->owner_nick) { $html = profile_tabs(get_app(), (($is_owner) ? true : false), $this->auth->owner_nick); } @@ -208,9 +208,9 @@ class RedBrowser extends DAV\Browser\Plugin { $ft['displayName'] = $displayName; $ft['type'] = $type; $ft['size'] = $size; - $ft['sizeFormatted'] = $this->userReadableSize($size); + $ft['sizeFormatted'] = userReadableSize($size); $ft['lastmodified'] = (($lastmodified) ? datetime_convert('UTC', date_default_timezone_get(), $lastmodified) : ''); - $ft['iconFromType'] = $this->getIconFromType($type); + $ft['iconFromType'] = getIconFromType($type); $f[] = $ft; } @@ -224,13 +224,13 @@ class RedBrowser extends DAV\Browser\Plugin { if ($used) { $quotaDesc = t('%1$s used'); $quotaDesc = sprintf($quotaDesc, - $this->userReadableSize($used)); + userReadableSize($used)); } if ($limit && $used) { $quotaDesc = t('%1$s used of %2$s (%3$s%)'); $quotaDesc = sprintf($quotaDesc, - $this->userReadableSize($used), - $this->userReadableSize($limit), + userReadableSize($used), + userReadableSize($limit), round($used / $limit, 1)); } @@ -282,29 +282,6 @@ class RedBrowser extends DAV\Browser\Plugin { construct_page(get_app()); } - /** - * @brief Returns a human readable formatted string for filesizes. - * - * Don't we need such a functionality in other places, too? - * - * @param int $size filesize in bytes - * @return string - */ - function userReadableSize($size) { - $ret = ""; - if (is_numeric($size)) { - $incr = 0; - $k = 1024; - $unit = array('bytes', 'KB', 'MB', 'GB', 'TB', 'PB'); - while (($size / $k) >= 1){ - $incr++; - $size = round($size / $k, 2); - } - $ret = $size . " " . $unit[$incr]; - } - return $ret; - } - /** * @brief Creates a form to add new folders and upload files. * @@ -339,65 +316,6 @@ class RedBrowser extends DAV\Browser\Plugin { return z_root() . '/cloud/?sabreAction=asset&assetName=' . urlencode($assetName); } - /** - * @brief returns icon name for use with e.g. font-awesome based on mime-type - * - * @param string $type - * @return string - */ - protected function getIconFromType($type) { - $iconMap = array( - //Folder - t('Collection') => 'icon-folder-close', - - //Common file - 'application/octet-stream' => 'icon-file-alt', - - //Text - 'text/plain' => 'icon-file-text-alt', - 'application/msword' => 'icon-file-text-alt', - 'application/pdf' => 'icon-file-text-alt', - 'application/vnd.oasis.opendocument.text' => 'icon-file-text-alt', - 'application/epub+zip' => 'icon-book', - - //Spreadsheet - 'application/vnd.oasis.opendocument.spreadsheet' => 'icon-table', - 'application/vnd.ms-excel' => 'icon-table', - - //Image - 'image/jpeg' => 'icon-picture', - 'image/png' => 'icon-picture', - 'image/gif' => 'icon-picture', - 'image/svg+xml' => 'icon-picture', - - //Archive - 'application/zip' => 'icon-archive', - 'application/x-rar-compressed' => 'icon-archive', - - //Audio - 'audio/mpeg' => 'icon-music', - 'audio/wav' => 'icon-music', - 'application/ogg' => 'icon-music', - 'audio/ogg' => 'icon-music', - 'audio/webm' => 'icon-music', - 'audio/mp4' => 'icon-music', - - //Video - 'video/quicktime' => 'icon-film', - 'video/webm' => 'icon-film', - 'video/mp4' => 'icon-film' - ); - - $iconFromType = 'icon-file-alt'; - - if (array_key_exists($type, $iconMap)) - { - $iconFromType = $iconMap[$type]; - } - - return $iconFromType; - } - /** * @brief Return the hash of an attachment. * @@ -412,6 +330,7 @@ class RedBrowser extends DAV\Browser\Plugin { * The name of the attachment * @return string */ + protected function findAttachHash($owner, $parentHash, $attachName) { $r = q("SELECT hash FROM attach WHERE uid = %d AND folder = '%s' AND filename = '%s' ORDER BY edited DESC LIMIT 1", intval($owner), diff --git a/include/text.php b/include/text.php index 47694a17c..cfe87991c 100644 --- a/include/text.php +++ b/include/text.php @@ -2378,3 +2378,74 @@ function linkify_tags($a, &$body, $uid) { return $results; } +/** + * @brief returns icon name for use with e.g. font-awesome based on mime-type + * + * @param string $type + * @return string + */ +function getIconFromType($type) { + $iconMap = array( + //Folder + t('Collection') => 'icon-folder-close', + //Common file + 'application/octet-stream' => 'icon-file-alt', + //Text + 'text/plain' => 'icon-file-text-alt', + 'application/msword' => 'icon-file-text-alt', + 'application/pdf' => 'icon-file-text-alt', + 'application/vnd.oasis.opendocument.text' => 'icon-file-text-alt', + 'application/epub+zip' => 'icon-book', + //Spreadsheet + 'application/vnd.oasis.opendocument.spreadsheet' => 'icon-table', + 'application/vnd.ms-excel' => 'icon-table', + //Image + 'image/jpeg' => 'icon-picture', + 'image/png' => 'icon-picture', + 'image/gif' => 'icon-picture', + 'image/svg+xml' => 'icon-picture', + //Archive + 'application/zip' => 'icon-archive', + 'application/x-rar-compressed' => 'icon-archive', + //Audio + 'audio/mpeg' => 'icon-music', + 'audio/wav' => 'icon-music', + 'application/ogg' => 'icon-music', + 'audio/ogg' => 'icon-music', + 'audio/webm' => 'icon-music', + 'audio/mp4' => 'icon-music', + //Video + 'video/quicktime' => 'icon-film', + 'video/webm' => 'icon-film', + 'video/mp4' => 'icon-film' + ); + + $iconFromType = 'icon-file-alt'; + + if (array_key_exists($type, $iconMap)) { + $iconFromType = $iconMap[$type]; + } + + return $iconFromType; +} + +/** + * @brief Returns a human readable formatted string for filesizes. + * + * @param int $size filesize in bytes + * @return string + */ +function userReadableSize($size) { + $ret = ""; + if (is_numeric($size)) { + $incr = 0; + $k = 1024; + $unit = array('bytes', 'KB', 'MB', 'GB', 'TB', 'PB'); + while (($size / $k) >= 1){ + $incr++; + $size = round($size / $k, 2); + } + $ret = $size . " " . $unit[$incr]; + } + return $ret; +} -- cgit v1.2.3 From 2f4ef7660c82f7b8878a7c2d14c9e69a52b8fbc0 Mon Sep 17 00:00:00 2001 From: friendica Date: Tue, 27 Jan 2015 15:47:24 -0800 Subject: improved route mismatch detection. We will be less strict about the absolute route matching and only look at the last hop before it got to us - which is ultimately all we should care about (since that sender controls the thread permissions). Route mismatches seem to occur somewhat frequently from yamkote (for unknown reasons), and the logging has been improved a bit so it should provide some slightly more useful debugging info in case it still happens going forward. Oh, also we'll set the parent on comments when we store the initial post (item_store()) and only go back and set the parent for top-level posts. This should reduce the number of comments with missing parents on shared hosts, but may increase the number of missing threads. Probably worthwhile to do a query occasionally for parent = 0 and see how we're doing and how many have shared host related delivery issues. --- include/items.php | 53 ++++++++++++++++++++--------------------------------- include/zot.php | 24 ++++++++++++++++++++++-- 2 files changed, 42 insertions(+), 35 deletions(-) (limited to 'include') diff --git a/include/items.php b/include/items.php index fb2f2586a..70802404a 100755 --- a/include/items.php +++ b/include/items.php @@ -2186,6 +2186,20 @@ function item_store($arr,$allow_exec = false) { unset($arr['term']); } + if(strlen($allow_cid) || strlen($allow_gid) || strlen($deny_cid) || strlen($deny_gid) || strlen($public_policy)) + $private = 1; + else + $private = $arr['item_private']; + + $arr['parent'] = $parent_id; + $arr['allow_cid'] = $allow_cid; + $arr['allow_gid'] = $allow_gid; + $arr['deny_cid'] = $deny_cid; + $arr['deny_gid'] = $deny_gid; + $arr['public_policy'] = $public_policy; + $arr['item_private'] = $private; + $arr['comments_closed'] = $comments_closed; + logger('item_store: ' . print_r($arr,true), LOGGER_DATA); dbesc_array($arr); @@ -2203,7 +2217,6 @@ function item_store($arr,$allow_exec = false) { intval($arr['uid']) ); - if($r && count($r)) { $current_post = $r[0]['id']; $arr = $r[0]; // This will gives us a fresh copy of what's now in the DB and undo the db escaping, which really messes up the notifications @@ -2223,40 +2236,14 @@ function item_store($arr,$allow_exec = false) { ); } - if((! $parent_id) || ($arr['parent_mid'] === $arr['mid'])) - $parent_id = $current_post; - - if(strlen($allow_cid) || strlen($allow_gid) || strlen($deny_cid) || strlen($deny_gid) || strlen($public_policy)) - $private = 1; - else - $private = $arr['item_private']; + $arr['id'] = $current_post; - // Set parent id - and also make sure to inherit the parent's ACL's. - - $r = q("UPDATE item SET parent = %d, allow_cid = '%s', allow_gid = '%s', - deny_cid = '%s', deny_gid = '%s', public_policy = '%s', item_private = %d, comments_closed = '%s' - WHERE id = %d", - intval($parent_id), - dbesc($allow_cid), - dbesc($allow_gid), - dbesc($deny_cid), - dbesc($deny_gid), - dbesc($public_policy), - intval($private), - dbesc($comments_closed), - intval($current_post) - ); + if(! intval($r[0]['parent'])) { + $x = q("update item set parent = id where id = %d", + intval($r[0]['id']) + ); + } - // These are probably redundant now that we've queried the just stored post - $arr['id'] = $current_post; - $arr['parent'] = $parent_id; - $arr['allow_cid'] = $allow_cid; - $arr['allow_gid'] = $allow_gid; - $arr['deny_cid'] = $deny_cid; - $arr['deny_gid'] = $deny_gid; - $arr['public_policy'] = $public_policy; - $arr['item_private'] = $private; - $arr['comments_closed'] = $comments_closed; // Store taxonomy diff --git a/include/zot.php b/include/zot.php index bedc0c1b5..2fcada429 100644 --- a/include/zot.php +++ b/include/zot.php @@ -1522,14 +1522,34 @@ function process_delivery($sender,$arr,$deliveries,$relay,$public = false,$reque // going downstream check that we have the same upstream provider that // sent it to us originally. Ignore it if it came from another source - // (with potentially different permissions) + // (with potentially different permissions). + // only compare the last hop since it could have arrived at the last location any number of ways. + // Always accept empty routes. + + $existing_route = explode(',', $r[0]['route']); + $routes = count($existing_route); + if($routes) { + $last_hop = array_pop($existing_route); + $last_prior_route = implode(',',$existing_route); + } + else { + $last_hop = ''; + $last_prior_route = ''; + } $current_route = (($arr['route']) ? $arr['route'] . ',' : '') . $sender['hash']; - if($r[0]['route'] != $current_route) { + if($last_hop && $last_hop != $sender['hash']) { + logger('comment route mismatch: parent route = ' . $r[0]['route'] . ' expected = ' . $current_route, LOGGER_DEBUG); + logger('comment route mismatch: parent msg = ' . $r[0]['id'],LOGGER_DEBUG); $result[] = array($d['hash'],'comment route mismatch',$channel['channel_name'] . ' <' . $channel['channel_address'] . '@' . get_app()->get_hostname() . '>',$arr['mid']); continue; } + + // we'll add sender['hash'] onto this when we deliver it. $last_prior_route now has the previously stored route + // *except* for the sender['hash'] which would've been the last hop before it got to us. + + $arr['route'] = $last_prior_route; } } -- cgit v1.2.3 From 21f85b32ecaa89a584c29cdf1ef7726cbbb70bb3 Mon Sep 17 00:00:00 2001 From: friendica Date: Tue, 27 Jan 2015 17:46:16 -0800 Subject: we need to actually ask for the id from the DB if we want to use it. --- include/zot.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include') diff --git a/include/zot.php b/include/zot.php index 2fcada429..3cf54e54e 100644 --- a/include/zot.php +++ b/include/zot.php @@ -1485,7 +1485,7 @@ function process_delivery($sender,$arr,$deliveries,$relay,$public = false,$reque // As a side effect we will also do a preliminary check that we have the top-level-post, otherwise // processing it is pointless. - $r = q("select route from item where mid = '%s' and uid = %d limit 1", + $r = q("select route, id from item where mid = '%s' and uid = %d limit 1", dbesc($arr['parent_mid']), intval($channel['channel_id']) ); -- cgit v1.2.3 From 85b359e25c733deeadac4c3c8f8b073fe578f0d3 Mon Sep 17 00:00:00 2001 From: friendica Date: Tue, 27 Jan 2015 17:53:19 -0800 Subject: ignore route mismatches on firehose posts to the sys channel. Use whatever parent route we have. By definition we aren't going to have permission issues with these things. --- include/zot.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include') diff --git a/include/zot.php b/include/zot.php index 3cf54e54e..43a7ad6ba 100644 --- a/include/zot.php +++ b/include/zot.php @@ -1539,7 +1539,7 @@ function process_delivery($sender,$arr,$deliveries,$relay,$public = false,$reque $current_route = (($arr['route']) ? $arr['route'] . ',' : '') . $sender['hash']; - if($last_hop && $last_hop != $sender['hash']) { + if($last_hop && $last_hop != $sender['hash'] && $sender['hash'] != 'undefined') { logger('comment route mismatch: parent route = ' . $r[0]['route'] . ' expected = ' . $current_route, LOGGER_DEBUG); logger('comment route mismatch: parent msg = ' . $r[0]['id'],LOGGER_DEBUG); $result[] = array($d['hash'],'comment route mismatch',$channel['channel_name'] . ' <' . $channel['channel_address'] . '@' . get_app()->get_hostname() . '>',$arr['mid']); -- cgit v1.2.3