diff options
author | habeascodice <habeascodice@federated.social> | 2014-11-01 03:04:11 -0700 |
---|---|---|
committer | habeascodice <habeascodice@federated.social> | 2014-11-01 03:04:11 -0700 |
commit | 31376de0665091f2dba04755562ccd238d57a13c (patch) | |
tree | ae59c8697b9fd20c33aeaf8acb3a698b63e9657b /include/notifier.php | |
parent | c854f8c238da2df08b52249142ad24ef66e422d1 (diff) | |
parent | 50c16c394fe2d966c62d30930600212a4e33303e (diff) | |
download | volse-hubzilla-31376de0665091f2dba04755562ccd238d57a13c.tar.gz volse-hubzilla-31376de0665091f2dba04755562ccd238d57a13c.tar.bz2 volse-hubzilla-31376de0665091f2dba04755562ccd238d57a13c.zip |
Merge remote branch 'upstream/master'
Diffstat (limited to 'include/notifier.php')
-rw-r--r-- | include/notifier.php | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/include/notifier.php b/include/notifier.php index 79a6886ad..c193db116 100644 --- a/include/notifier.php +++ b/include/notifier.php @@ -58,6 +58,7 @@ require_once('include/html2plain.php'); * expire channel_id * relay item_id (item was relayed to owner, we will deliver it as owner) * location channel_id + * request channel_id xchan_hash message_id * */ @@ -142,6 +143,7 @@ function notifier_run($argv, $argc){ $expire = false; + $request = false; $mail = false; $fsuggest = false; $top_level = false; @@ -175,6 +177,22 @@ function notifier_run($argv, $argc){ $channel = $s[0]; } + elseif($cmd === 'request') { + $channel_id = $item_id; + $xchan = $argv[3]; + $request_message_id = $argv[4]; + + $s = q("select * from channel where channel_id = %d limit 1", + intval($channel_id) + ); + if($s) + $channel = $s[0]; + + $private = true; + $recipients[] = $xchan; + $packet_type = 'request'; + $normal_mode = false; + } elseif($cmd === 'expire') { // FIXME @@ -550,6 +568,7 @@ function notifier_run($argv, $argc){ 'mail' => $mail, 'location' => $location, 'fsuggest' => $fsuggest, + 'request' => $request, 'normal_mode' => $normal_mode, 'packet_type' => $packet_type, 'walltowall' => $walltowall @@ -579,6 +598,21 @@ function notifier_run($argv, $argc){ dbesc('') ); } + elseif($packet_type === 'request') { + $n = zot_build_packet($channel,'request',$env_recips,$hub['hubloc_sitekey'],$hash,array('message_id' => $request_message_id)); + q("insert into outq ( outq_hash, outq_account, outq_channel, outq_driver, outq_posturl, outq_async, outq_created, outq_updated, outq_notify, outq_msg ) values ( '%s', %d, %d, '%s', '%s', %d, '%s', '%s', '%s', '%s' )", + dbesc($hash), + intval($channel['channel_account_id']), + intval($channel['channel_id']), + dbesc('zot'), + dbesc($hub['hubloc_callback']), + intval(1), + dbesc(datetime_convert()), + dbesc(datetime_convert()), + dbesc($n), + dbesc('') + ); + } else { $n = zot_build_packet($channel,'notify',$env_recips,(($private) ? $hub['hubloc_sitekey'] : null),$hash); q("insert into outq ( outq_hash, outq_account, outq_channel, outq_driver, outq_posturl, outq_async, outq_created, outq_updated, outq_notify, outq_msg ) values ( '%s', %d, %d, '%s', '%s', %d, '%s', '%s', '%s', '%s' )", |