Some corrections
This commit is contained in:
parent
680b16d036
commit
cb5df4d715
|
@ -743,8 +743,7 @@ class Diaspora {
|
||||||
dbesc($handle)
|
dbesc($handle)
|
||||||
);
|
);
|
||||||
|
|
||||||
if ($r) {
|
if (dbm::is_result($r)) {
|
||||||
//logger("Found contact ".$r[0]['id']." for user ".$uid." and handle ".$handle." - first try", LOGGER_DEBUG);
|
|
||||||
return $r[0];
|
return $r[0];
|
||||||
} else {
|
} else {
|
||||||
// We haven't found it?
|
// We haven't found it?
|
||||||
|
@ -755,7 +754,6 @@ class Diaspora {
|
||||||
$r = q("SELECT * FROM `contact` WHERE `id` = %d LIMIT 1", intval($cid));
|
$r = q("SELECT * FROM `contact` WHERE `id` = %d LIMIT 1", intval($cid));
|
||||||
|
|
||||||
if (dbm::is_result($r)) {
|
if (dbm::is_result($r)) {
|
||||||
logger("Found contact ".$r[0]['id']." for user ".$uid." and handle ".$handle." - second try", LOGGER_DEBUG);
|
|
||||||
return $r[0];
|
return $r[0];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -769,7 +767,6 @@ class Diaspora {
|
||||||
dbesc($nurl_sql)
|
dbesc($nurl_sql)
|
||||||
);
|
);
|
||||||
if(dbm::is_result($r)) {
|
if(dbm::is_result($r)) {
|
||||||
logger("Found contact ".$r[0]['id']." for user ".$uid." and handle ".$handle." - third try", LOGGER_DEBUG);
|
|
||||||
return $r[0];
|
return $r[0];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -848,12 +845,12 @@ class Diaspora {
|
||||||
* @return int|bool message id if the message already was stored into the system - or false.
|
* @return int|bool message id if the message already was stored into the system - or false.
|
||||||
*/
|
*/
|
||||||
private static function message_exists($uid, $guid) {
|
private static function message_exists($uid, $guid) {
|
||||||
$r = q("SELECT `guid` FROM `item` WHERE `uid` = %d AND `guid` = '%s' LIMIT 1",
|
$r = q("SELECT `id` FROM `item` WHERE `uid` = %d AND `guid` = '%s' LIMIT 1",
|
||||||
intval($uid),
|
intval($uid),
|
||||||
dbesc($guid)
|
dbesc($guid)
|
||||||
);
|
);
|
||||||
|
|
||||||
if ($r) {
|
if (dbm::is_result($r)) {
|
||||||
logger("message ".$guid." already exists for user ".$uid);
|
logger("message ".$guid." already exists for user ".$uid);
|
||||||
return $r[0]["id"];
|
return $r[0]["id"];
|
||||||
}
|
}
|
||||||
|
|
|
@ -27,7 +27,7 @@ function auto_redir(&$a, $contact_nick) {
|
||||||
$baseurl = substr($baseurl, $domain_st + 3);
|
$baseurl = substr($baseurl, $domain_st + 3);
|
||||||
$nurl = normalise_link($baseurl);
|
$nurl = normalise_link($baseurl);
|
||||||
|
|
||||||
/// @todo Why is there a query for "nurl" *and* "nurl"? Especially this normalising is strange.
|
/// @todo Why is there a query for "url" *and* "nurl"? Especially this normalising is strange.
|
||||||
$r = q("SELECT `id` FROM `contact` WHERE `uid` = (SELECT `uid` FROM `user` WHERE `nickname` = '%s' LIMIT 1)
|
$r = q("SELECT `id` FROM `contact` WHERE `uid` = (SELECT `uid` FROM `user` WHERE `nickname` = '%s' LIMIT 1)
|
||||||
AND `nick` = '%s' AND NOT `self` AND (`url` LIKE '%%%s%%' OR `nurl` LIKE '%%%s%%') AND NOT `blocked` AND NOT `pending` LIMIT 1",
|
AND `nick` = '%s' AND NOT `self` AND (`url` LIKE '%%%s%%' OR `nurl` LIKE '%%%s%%') AND NOT `blocked` AND NOT `pending` LIMIT 1",
|
||||||
dbesc($contact_nick),
|
dbesc($contact_nick),
|
||||||
|
|
Loading…
Reference in a new issue