aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorFriendika <info@friendika.com>2011-06-26 19:30:57 -0700
committerFriendika <info@friendika.com>2011-06-26 19:30:57 -0700
commit3fe1e197254f62e5377c28a24e4d5a75014e931b (patch)
treea920b222eedb539ae114f998089af3b1ea07ead5 /include
parentf7964efa52f7efa8159403568a59e320209cbffa (diff)
downloadvolse-hubzilla-3fe1e197254f62e5377c28a24e4d5a75014e931b.tar.gz
volse-hubzilla-3fe1e197254f62e5377c28a24e4d5a75014e931b.tar.bz2
volse-hubzilla-3fe1e197254f62e5377c28a24e4d5a75014e931b.zip
pass notify endpoint with friend suggestions
Diffstat (limited to 'include')
-rw-r--r--include/notifier.php32
1 files changed, 31 insertions, 1 deletions
diff --git a/include/notifier.php b/include/notifier.php
index 842e11080..d9f903853 100644
--- a/include/notifier.php
+++ b/include/notifier.php
@@ -71,6 +71,16 @@ function notifier_run($argv, $argc){
if(! count($items))
return;
}
+ elseif($cmd === 'suggest') {
+ $suggest = q("SELECT * FROM `fsuggest` WHERE `id` = %d LIMIT 1",
+ intval($item_id)
+ );
+ if(! count($suggest))
+ return;
+ $uid = $suggest[0]['uid'];
+ $recipients[] = $suggest[0]['cid'];
+ $item = $suggest[0];
+ }
else {
// find ancestors
@@ -126,7 +136,7 @@ function notifier_run($argv, $argc){
// fill this in with a single salmon slap if applicable
$slap = '';
- if($cmd != 'mail') {
+ if($cmd != 'mail' && $cmd != 'suggest') {
require_once('include/group.php');
@@ -236,6 +246,26 @@ function notifier_run($argv, $argc){
'$parent_id' => xmlify($item['parent-uri'])
));
}
+ elseif($cmd === 'suggest') {
+ $notify_hub = false; // suggestions are not public
+
+ $sugg_template = get_markup_template('atom_suggest.tpl');
+
+ $atom .= replace_macros($sugg_template, array(
+ '$name' => xmlify($item['name']),
+ '$url' => xmlify($item['url']),
+ '$photo' => xmlify($item['photo']),
+ '$request' => xmlify($item['request']),
+ '$note' => xmlify($item['note'])
+ ));
+
+ // We don't need this any more
+
+ q("DELETE FROM `fsuggest` WHERE `id` = %d LIMIT 1",
+ intval($item['id'])
+ );
+
+ }
else {
if($followup) {
foreach($items as $item) { // there is only one item