Skip to content

Commit

Permalink
Bugfix: You wasn't able to add an OStatus contact when you are follow…
Browse files Browse the repository at this point in the history
…ing the same contact via Statusnet connector.
  • Loading branch information
annando committed May 31, 2015
1 parent 2856042 commit fae3592
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions mod/follow.php
Expand Up @@ -14,8 +14,11 @@ function follow_content(&$a) {
$uid = local_user();
$url = notags(trim($_REQUEST['url']));

$r = q("SELECT `url` FROM `contact` WHERE `uid` = %d AND (`nurl` = '%s' OR `alias` = '%s' OR `alias` = '%s') LIMIT 1",
intval(local_user()), dbesc(normalise_link($url)), dbesc(normalise_link($url)), dbesc($url));
$r = q("SELECT `url` FROM `contact` WHERE `uid` = %d AND
(`nurl` = '%s' OR `alias` = '%s' OR `alias` = '%s') AND
`network` != '%s' LIMIT 1",
intval(local_user()), dbesc(normalise_link($url)),
dbesc(normalise_link($url)), dbesc($url), dbesc(NETWORK_STATUSNET));

if ($r) {
notice(t('You already added this contact.').EOL);
Expand Down

0 comments on commit fae3592

Please sign in to comment.