mirror of
https://git.sekbaer.de/Friendica/friendica.git
synced 2025-06-12 01:54:26 +02:00
pass notify endpoint with friend suggestions
This commit is contained in:
parent
f7964efa52
commit
3fe1e19725
6 changed files with 49 additions and 11 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue