Better reshare detection
This commit is contained in:
parent
468734a26e
commit
e058feed28
|
@ -1600,7 +1600,7 @@ class diaspora {
|
||||||
|
|
||||||
// Maybe it is already a reshared item?
|
// Maybe it is already a reshared item?
|
||||||
// Then refetch the content, since there can be many side effects with reshared posts from other networks or reshares from reshares
|
// Then refetch the content, since there can be many side effects with reshared posts from other networks or reshares from reshares
|
||||||
if (self::is_reshare($r[0]["body"]))
|
if (self::is_reshare($r[0]["body"], false))
|
||||||
$r = array();
|
$r = array();
|
||||||
else
|
else
|
||||||
return $r[0];
|
return $r[0];
|
||||||
|
@ -2130,7 +2130,7 @@ class diaspora {
|
||||||
return self::build_and_transmit($owner, $contact, "retraction", $message);
|
return self::build_and_transmit($owner, $contact, "retraction", $message);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function is_reshare($body) {
|
public static function is_reshare($body, $complete = true) {
|
||||||
$body = trim($body);
|
$body = trim($body);
|
||||||
|
|
||||||
// Skip if it isn't a pure repeated messages
|
// Skip if it isn't a pure repeated messages
|
||||||
|
@ -2147,6 +2147,10 @@ class diaspora {
|
||||||
if ($body == $attributes)
|
if ($body == $attributes)
|
||||||
return(false);
|
return(false);
|
||||||
|
|
||||||
|
// If we don't do the complete check we quit here
|
||||||
|
if (!$complete)
|
||||||
|
return true;
|
||||||
|
|
||||||
$guid = "";
|
$guid = "";
|
||||||
preg_match("/guid='(.*?)'/ism", $attributes, $matches);
|
preg_match("/guid='(.*?)'/ism", $attributes, $matches);
|
||||||
if ($matches[1] != "")
|
if ($matches[1] != "")
|
||||||
|
|
Loading…
Reference in a new issue