aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorfriendica <info@friendica.com>2012-06-07 20:20:13 -0700
committerfriendica <info@friendica.com>2012-06-07 20:20:13 -0700
commit0820865265a6600491b4bfe5d458c33d54ba1409 (patch)
treea8ac606f254489250c57f61f5558d4ab6b5e145f
parentda7773a259bfd40b1c2346fb7c3900f2b67e8fec (diff)
downloadvolse-hubzilla-0820865265a6600491b4bfe5d458c33d54ba1409.tar.gz
volse-hubzilla-0820865265a6600491b4bfe5d458c33d54ba1409.tar.bz2
volse-hubzilla-0820865265a6600491b4bfe5d458c33d54ba1409.zip
provide ability to autofriend ostatus accounts
-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?