automatically redirect repeat to share for posts with unresolvable message-ids (diaspora, hz < 4.0, etc.).
This commit is contained in:
parent
92e6c21210
commit
f02af5fe6e
@ -27,13 +27,15 @@ class Share extends \Zotlabs\Web\Controller {
|
|||||||
|
|
||||||
$channel = App::get_channel();
|
$channel = App::get_channel();
|
||||||
|
|
||||||
|
|
||||||
$r = q("SELECT * from item left join xchan on author_xchan = xchan_hash WHERE id = %d LIMIT 1",
|
$r = q("SELECT * from item left join xchan on author_xchan = xchan_hash WHERE id = %d LIMIT 1",
|
||||||
intval($post_id)
|
intval($post_id)
|
||||||
);
|
);
|
||||||
if(! $r)
|
if(! $r)
|
||||||
killme();
|
killme();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if(($r[0]['item_private']) && ($r[0]['xchan_network'] !== 'rss'))
|
if(($r[0]['item_private']) && ($r[0]['xchan_network'] !== 'rss'))
|
||||||
killme();
|
killme();
|
||||||
|
|
||||||
@ -49,8 +51,12 @@ class Share extends \Zotlabs\Web\Controller {
|
|||||||
|
|
||||||
if($r[0]['mimetype'] !== 'text/bbcode')
|
if($r[0]['mimetype'] !== 'text/bbcode')
|
||||||
killme();
|
killme();
|
||||||
|
|
||||||
|
if(strpos($r[0]['mid'],'http') === false) {
|
||||||
|
notice( t('Source message cannot be repeated. Sharing instead.') . EOL);
|
||||||
|
goaway(z_root() . '/embed/' . argv(1));
|
||||||
|
}
|
||||||
|
|
||||||
xchan_query($r);
|
xchan_query($r);
|
||||||
|
|
||||||
$arr = [];
|
$arr = [];
|
||||||
|
Reference in New Issue
Block a user