aboutsummaryrefslogtreecommitdiffstats
path: root/include/notifier.php
diff options
context:
space:
mode:
authorThomas Willingham <beardyunixer@beardyunixer.com>2014-09-15 17:10:11 +0100
committerThomas Willingham <beardyunixer@beardyunixer.com>2014-09-15 17:10:11 +0100
commit68ecc673b109be50dc04cf72af8ce2296c70b86b (patch)
tree0ecaa24425d2f69528ad99763d929cccd677d148 /include/notifier.php
parente3b967f475e8933567ba7d80dacb6d496224fe55 (diff)
parenteaf3bd3326a657662321df791280b41293f54ef2 (diff)
downloadvolse-hubzilla-68ecc673b109be50dc04cf72af8ce2296c70b86b.tar.gz
volse-hubzilla-68ecc673b109be50dc04cf72af8ce2296c70b86b.tar.bz2
volse-hubzilla-68ecc673b109be50dc04cf72af8ce2296c70b86b.zip
Merge remote-tracking branch 'upstream/master'
Diffstat (limited to 'include/notifier.php')
-rw-r--r--include/notifier.php27
1 files changed, 27 insertions, 0 deletions
diff --git a/include/notifier.php b/include/notifier.php
index 0b5744b29..ae781bcf8 100644
--- a/include/notifier.php
+++ b/include/notifier.php
@@ -57,6 +57,7 @@ require_once('include/html2plain.php');
* purge_all channel_id
* expire channel_id
* relay item_id (item was relayed to owner, we will deliver it as owner)
+ * location channel_id
*
*/
@@ -144,6 +145,7 @@ function notifier_run($argv, $argc){
$mail = false;
$fsuggest = false;
$top_level = false;
+ $location = false;
$recipients = array();
$url_recipients = array();
$normal_mode = true;
@@ -230,6 +232,30 @@ function notifier_run($argv, $argc){
$private = false;
$packet_type = 'refresh';
}
+ elseif($cmd === 'location') {
+ logger('notifier: location: ' . $item_id);
+ $s = q("select * from channel where channel_id = %d limit 1",
+ intval($item_id)
+ );
+ if($s)
+ $channel = $s[0];
+ $uid = $item_id;
+ $recipients = array();
+ $r = q("select abook_xchan from abook where abook_channel = %d",
+ intval($item_id)
+ );
+ if($r) {
+ foreach($r as $rr) {
+ $recipients[] = $rr['abook_xchan'];
+ }
+ }
+
+ $encoded_item = array('locations' => zot_encode_locations($channel),'type' => 'location', 'encoding' => 'zot');
+ $target_item = array('aid' => $channel['channel_account_id'],'uid' => $channel['channel_id']);
+ $private = false;
+ $packet_type = 'location';
+ $location = true;
+ }
elseif($cmd === 'purge_all') {
logger('notifier: purge_all: ' . $item_id);
$s = q("select * from channel where channel_id = %d limit 1",
@@ -516,6 +542,7 @@ function notifier_run($argv, $argc){
'cmd' => $cmd,
'expire' => $expire,
'mail' => $mail,
+ 'location' => $location,
'fsuggest' => $fsuggest,
'normal_mode' => $normal_mode,
'packet_type' => $packet_type,