]> git.mxchange.org Git - friendica.git/blobdiff - include/notifier.php
a few more fsw tweaks
[friendica.git] / include / notifier.php
index bef46677c44a6566130147075123e6b30671670a..069f3bdf2e37abb655237ac8edbb6692d442b375 100644 (file)
@@ -72,7 +72,7 @@
                        killme();
        }
 
-       $r = q("SELECT `contact`.*, `user`.`nickname` 
+       $r = q("SELECT `contact`.*, `user`.`nickname`, `user`.`sprvkey`, `user`.`spubkey`, `user`.`page-flags` 
                FROM `contact` LEFT JOIN `user` ON `user`.`uid` = `contact`.`uid` 
                WHERE `contact`.`uid` = %d AND `contact`.`self` = 1 LIMIT 1",
                intval($uid)
@@ -87,6 +87,9 @@
        // If this is a public conversation, notify the feed hub
        $notify_hub = true;
 
+       // fill this in with a salmon slap if applicable
+       $slap = '';
+
        if($cmd != 'mail') {
 
                require_once('include/group.php');
                        $recipients = array_diff($recipients,$deny);
 
                        $conversant_str = dbesc(implode(', ',$conversants));
-
-
                }
 
                $r = q("SELECT * FROM `contact` WHERE `id` IN ( $conversant_str ) AND `blocked` = 0 AND `pending` = 0");
                                $actobj = construct_activity($item);
 
                                if($item['id'] == $item_id) {
-                                       $atom .= replace_macros($cmnt_template, array(
+                                       $slap = replace_macros($cmnt_template, array(
                                                '$name'               => xmlify($owner['name']),
                                                '$profile_page'       => xmlify($owner['url']),
                                                '$thumb'              => xmlify($owner['thumb']),
                                                '$published'          => xmlify(datetime_convert('UTC', 'UTC', $item['created'] . '+00:00' , ATOM_TIME)),
                                                '$updated'            => xmlify(datetime_convert('UTC', 'UTC', $item['edited']  . '+00:00' , ATOM_TIME)),
                                                '$location'           => xmlify($item['location']),
+                                               '$coord'              => xmlify($item['coord']),
                                                '$type'               => 'text',
                                                '$verb'               => xmlify($verb),
                                                '$actobj'             => $actobj,
                                        ));
                                }
                        }
+                       $atom .= $slap;
                }
                else {
                        foreach($items as $item) {
                                                        '$published'          => xmlify(datetime_convert('UTC', 'UTC', $item['created'] . '+00:00' , ATOM_TIME)),
                                                        '$updated'            => xmlify(datetime_convert('UTC', 'UTC', $item['edited']  . '+00:00' , ATOM_TIME)),
                                                        '$location'           => xmlify($item['location']),
+                                                       '$coord'              => xmlify($item['coord']),
                                                        '$type'               => 'text',
                                                        '$verb'               => xmlify($verb),
                                                        '$actobj'             => $actobj,
                                                        '$content'       => xmlify($item['body']),
                                                        '$alt'           => xmlify($a->get_baseurl() . '/display/' . $owner['nickname'] . '/' . $item['id']),
                                                        '$location'      => xmlify($item['location']),
+                                                       '$coord'         => xmlify($item['coord']),
                                                        '$type'          => 'text',
                                                        '$verb'          => xmlify($verb),
                                                        '$actobj'        => $actobj,
 
        // delivery loop
 
+
+
        foreach($r as $contact) {
                if($contact['self'])
                        continue;
 
                switch($contact['network']) {
                        case 'dfrn':
-                               $deliver_status = dfrn_deliver($contact,$atom,$debugging);
+                               $deliver_status = dfrn_deliver($owner,$contact,$atom,$debugging);
                                break;
                        default:
+                               if($followup) {
+                                       require_once('include/salmon.php');
+                                       slapper($owner,$contact,$slap);
+                               }
                                break;
                }