aboutsummaryrefslogtreecommitdiffstats
path: root/mod/salmon.php
diff options
context:
space:
mode:
authorVasudev Kamath <kamathvasudev@gmail.com>2012-06-11 20:47:11 +0530
committerVasudev Kamath <kamathvasudev@gmail.com>2012-06-11 20:47:11 +0530
commit11974b4d948ae5d9b9fb53970838463bd88bb9f6 (patch)
tree426724e218a2fcaf3a1a2eedf6ffa591299755ee /mod/salmon.php
parent079fdecff1f4daa534045f4bd857e6ae6324474d (diff)
parentafa88154114d5632cb13e7c3f56143cccdfd7daa (diff)
downloadvolse-hubzilla-11974b4d948ae5d9b9fb53970838463bd88bb9f6.tar.gz
volse-hubzilla-11974b4d948ae5d9b9fb53970838463bd88bb9f6.tar.bz2
volse-hubzilla-11974b4d948ae5d9b9fb53970838463bd88bb9f6.zip
Merge branch 'master' of git://github.com/friendica/friendica
Diffstat (limited to 'mod/salmon.php')
-rw-r--r--mod/salmon.php16
1 files changed, 15 insertions, 1 deletions
diff --git a/mod/salmon.php b/mod/salmon.php
index 6172d17a1..1e16f9d14 100644
--- a/mod/salmon.php
+++ b/mod/salmon.php
@@ -170,14 +170,28 @@ function salmon_post(&$a) {
*
*/
- $r = q("SELECT * FROM `contact` WHERE `network` = 'stat' AND ( `url` = '%s' OR `alias` = '%s')
+ $r = q("SELECT * FROM `contact` WHERE `network` = '%s' AND ( `url` = '%s' OR `alias` = '%s' )
AND `uid` = %d LIMIT 1",
+ dbesc(NETWORK_OSTATUS),
dbesc($author_link),
dbesc($author_link),
intval($importer['uid'])
);
if(! count($r)) {
logger('mod-salmon: Author unknown to us.');
+ if(get_pconfig($importer['uid'],'system','ostatus_autofriend')) {
+ require_once('include/follow.php');
+ $result = new_contact($importer['uid'],$author_link);
+ if($result['success']) {
+ $r = q("SELECT * FROM `contact` WHERE `network` = '%s' AND ( `url` = '%s' OR `alias` = '%s' )
+ AND `uid` = %d LIMIT 1",
+ dbesc(NETWORK_OSTATUS),
+ dbesc($author_link),
+ dbesc($author_link),
+ intval($importer['uid'])
+ );
+ }
+ }
}
// is this a follower? Or have we ignored the person?