mirror of
https://codeberg.org/streams/streams.git
synced 2024-09-19 16:15:13 +00:00
more heavy lifting
This commit is contained in:
parent
fd4ea47503
commit
191edfdaa1
74 changed files with 190 additions and 164 deletions
|
@ -2,6 +2,8 @@
|
|||
|
||||
namespace Zotlabs\Daemon;
|
||||
|
||||
use Zotlabs\Lib\Libzot;
|
||||
|
||||
class Cron {
|
||||
|
||||
static public function run($argc,$argv) {
|
||||
|
@ -55,7 +57,6 @@ class Cron {
|
|||
db_utcnow()
|
||||
);
|
||||
if($r) {
|
||||
require_once('include/items.php');
|
||||
foreach($r as $rr)
|
||||
drop_item($rr['id'],false);
|
||||
}
|
||||
|
@ -110,7 +111,7 @@ class Cron {
|
|||
if($z) {
|
||||
xchan_query($z);
|
||||
$sync_item = fetch_post_tags($z);
|
||||
build_sync_packet($sync_item[0]['uid'],
|
||||
Libzot::build_sync_packet($sync_item[0]['uid'],
|
||||
[
|
||||
'item' => [ encode_item($sync_item[0],true) ]
|
||||
]
|
||||
|
|
|
@ -2,6 +2,8 @@
|
|||
|
||||
namespace Zotlabs\Daemon;
|
||||
|
||||
use Zotlabs\Lib\Libzot;
|
||||
|
||||
class Importfile {
|
||||
|
||||
static public function run($argc,$argv){
|
||||
|
@ -40,7 +42,7 @@ class Importfile {
|
|||
|
||||
$sync = attach_export_data($channel,$hash);
|
||||
if($sync)
|
||||
build_sync_packet($channel['channel_id'],array('file' => array($sync)));
|
||||
Libzot::build_sync_packet($channel['channel_id'],array('file' => array($sync)));
|
||||
|
||||
return;
|
||||
}
|
||||
|
|
|
@ -8,7 +8,6 @@ use Zotlabs\Lib\Libzot;
|
|||
require_once('include/queue_fn.php');
|
||||
require_once('include/html2plain.php');
|
||||
require_once('include/conversation.php');
|
||||
require_once('include/items.php');
|
||||
require_once('include/bbcode.php');
|
||||
|
||||
|
||||
|
|
|
@ -3,16 +3,12 @@
|
|||
namespace Zotlabs\Daemon;
|
||||
|
||||
require_once('include/queue_fn.php');
|
||||
|
||||
require_once('include/bbcode.php');
|
||||
|
||||
class Queue {
|
||||
|
||||
static public function run($argc,$argv) {
|
||||
|
||||
require_once('include/items.php');
|
||||
require_once('include/bbcode.php');
|
||||
|
||||
|
||||
if($argc > 1)
|
||||
$queue_id = $argv[1];
|
||||
else
|
||||
|
|
|
@ -11,9 +11,6 @@ class Ratenotif {
|
|||
|
||||
static public function run($argc,$argv) {
|
||||
|
||||
require_once("datetime.php");
|
||||
require_once('include/items.php');
|
||||
|
||||
if($argc < 3)
|
||||
return;
|
||||
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
|
||||
namespace Zotlabs\Lib;
|
||||
|
||||
use Zotlabs\Lib\Libzot;
|
||||
|
||||
class Activity {
|
||||
|
||||
|
@ -602,7 +603,7 @@ class Activity {
|
|||
'publicKeyPem' => $p['xchan_pubkey']
|
||||
];
|
||||
|
||||
$locs = zot_encode_locations($c);
|
||||
$locs = Libzot::encode_locations($c);
|
||||
if($locs) {
|
||||
$ret['nomadicLocations'] = [];
|
||||
foreach($locs as $loc) {
|
||||
|
@ -902,7 +903,7 @@ class Activity {
|
|||
if($abconfig)
|
||||
$clone['abconfig'] = $abconfig;
|
||||
|
||||
build_sync_packet($channel['channel_id'], [ 'abook' => array($clone) ] );
|
||||
Libzot::build_sync_packet($channel['channel_id'], [ 'abook' => array($clone) ] );
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -2,6 +2,8 @@
|
|||
|
||||
namespace Zotlabs\Lib;
|
||||
|
||||
use Zotlabs\Lib\Libzot;
|
||||
|
||||
/**
|
||||
* Apps
|
||||
*
|
||||
|
@ -445,7 +447,7 @@ class Apps {
|
|||
intval(TERM_OBJ_APP),
|
||||
intval($r[0]['id'])
|
||||
);
|
||||
build_sync_packet($uid,array('app' => $r[0]));
|
||||
Libzot::build_sync_packet($uid,array('app' => $r[0]));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -483,7 +485,7 @@ class Apps {
|
|||
);
|
||||
|
||||
// we don't sync system apps - they may be completely different on the other system
|
||||
build_sync_packet($uid,array('app' => $x));
|
||||
Libzot::build_sync_packet($uid,array('app' => $x));
|
||||
}
|
||||
}
|
||||
else {
|
||||
|
|
|
@ -1,6 +1,8 @@
|
|||
<?php
|
||||
namespace Zotlabs\Lib;
|
||||
|
||||
use Zotlabs\Lib\Libzot;
|
||||
|
||||
/**
|
||||
* @brief A class with chatroom related static methods.
|
||||
*/
|
||||
|
@ -91,7 +93,7 @@ class Chatroom {
|
|||
return $ret;
|
||||
}
|
||||
|
||||
build_sync_packet($channel['channel_id'],array('chatroom' => $r));
|
||||
Libzot::build_sync_packet($channel['channel_id'],array('chatroom' => $r));
|
||||
|
||||
q("delete from chatroom where cr_id = %d",
|
||||
intval($r[0]['cr_id'])
|
||||
|
|
|
@ -9,7 +9,6 @@ namespace Zotlabs\Lib;
|
|||
*/
|
||||
|
||||
require_once('include/crypto.php');
|
||||
require_once('include/items.php');
|
||||
require_once('include/queue_fn.php');
|
||||
|
||||
|
||||
|
@ -112,14 +111,14 @@ class Libzot {
|
|||
'type' => $type,
|
||||
'sender' => [
|
||||
'id' => $channel['channel_guid'],
|
||||
'id_sig' => zot_sign($channel['channel_guid'],$channel['channel_prvkey'],$sig_method),
|
||||
'id_sig' => self::sign($channel['channel_guid'],$channel['channel_prvkey'],$sig_method),
|
||||
'id_url' => z_root() . '/channel/' . $channel['channel_address'],
|
||||
'location' => z_root(),
|
||||
'location_sig' => zot_sign(z_root(),$channel['channel_prvkey'],$sig_method),
|
||||
'location_sig' => self::sign(z_root(),$channel['channel_prvkey'],$sig_method),
|
||||
'sitekey' => get_config('system','pubkey')
|
||||
],
|
||||
'callback' => '/zot',
|
||||
'version' => Zotlabs\Lib\System::get_zot_revision(),
|
||||
'version' => \Zotlabs\Lib\System::get_zot_revision(),
|
||||
'encryption' => crypto_methods(),
|
||||
'signing' => signing_methods()
|
||||
];
|
||||
|
@ -390,7 +389,7 @@ class Libzot {
|
|||
else {
|
||||
// if we were just granted read stream permission and didn't have it before, try to pull in some posts
|
||||
if((! $old_read_stream_perm) && (intval($permissions['view_stream'])))
|
||||
Zotlabs\Daemon\Master::Summon(array('Onepoll',$r[0]['abook_id']));
|
||||
\Zotlabs\Daemon\Master::Summon(array('Onepoll',$r[0]['abook_id']));
|
||||
}
|
||||
}
|
||||
else {
|
||||
|
@ -439,8 +438,8 @@ class Libzot {
|
|||
|
||||
if($new_connection) {
|
||||
if(! \Zotlabs\Access\Permissions::PermsCompare($new_perms,$previous_perms))
|
||||
Zotlabs\Daemon\Master::Summon(array('Notifier','permission_create',$new_connection[0]['abook_id']));
|
||||
Zotlabs\Lib\Enotify::submit(
|
||||
\Zotlabs\Daemon\Master::Summon(array('Notifier','permission_create',$new_connection[0]['abook_id']));
|
||||
\Zotlabs\Lib\Enotify::submit(
|
||||
[
|
||||
'type' => NOTIFY_INTRO,
|
||||
'from_xchan' => $x['hash'],
|
||||
|
@ -452,7 +451,7 @@ class Libzot {
|
|||
if(intval($permissions['view_stream'])) {
|
||||
if(intval(get_pconfig($channel['channel_id'],'perm_limits','send_stream') & PERMS_PENDING)
|
||||
|| (! intval($new_connection[0]['abook_pending'])))
|
||||
Zotlabs\Daemon\Master::Summon(array('Onepoll',$new_connection[0]['abook_id']));
|
||||
\Zotlabs\Daemon\Master::Summon(array('Onepoll',$new_connection[0]['abook_id']));
|
||||
}
|
||||
|
||||
|
||||
|
@ -1522,7 +1521,7 @@ class Libzot {
|
|||
// has a recipient, but in fact we don't require this, so it's technically
|
||||
// possible to send mail to anybody that's listening.
|
||||
|
||||
$recips = public_recips($msg);
|
||||
$recips = self::public_recips($msg);
|
||||
|
||||
if(! $recips)
|
||||
return $recips;
|
||||
|
@ -1604,7 +1603,7 @@ class Libzot {
|
|||
foreach($deliveries as $d) {
|
||||
$local_public = $public;
|
||||
|
||||
$DR = new Zotlabs\Lib\DReport(z_root(),$sender['hash'],$d['hash'],$arr['mid']);
|
||||
$DR = new \Zotlabs\Lib\DReport(z_root(),$sender['hash'],$d['hash'],$arr['mid']);
|
||||
|
||||
$r = q("select * from channel where channel_hash = '%s' limit 1",
|
||||
dbesc($d['hash'])
|
||||
|
@ -1718,7 +1717,7 @@ class Libzot {
|
|||
|
||||
if((! $relay) && (! $request) && (! $local_public)
|
||||
&& perm_is_allowed($channel['channel_id'],$sender['hash'],'send_stream')) {
|
||||
Zotlabs\Daemon\Master::Summon(array('Notifier', 'request', $channel['channel_id'], $sender['hash'], $arr['parent_mid']));
|
||||
\Zotlabs\Daemon\Master::Summon(array('Notifier', 'request', $channel['channel_id'], $sender['hash'], $arr['parent_mid']));
|
||||
}
|
||||
continue;
|
||||
}
|
||||
|
@ -1790,7 +1789,7 @@ class Libzot {
|
|||
|
||||
if($relay && $item_id) {
|
||||
logger('process_delivery: invoking relay');
|
||||
Zotlabs\Daemon\Master::Summon(array('Notifier','relay',intval($item_id)));
|
||||
\Zotlabs\Daemon\Master::Summon(array('Notifier','relay',intval($item_id)));
|
||||
$DR->update('relayed');
|
||||
$result[] = $DR->get();
|
||||
}
|
||||
|
@ -1900,7 +1899,7 @@ class Libzot {
|
|||
|
||||
if($relay && $item_id) {
|
||||
logger('Invoking relay');
|
||||
Zotlabs\Daemon\Master::Summon(array('Notifier','relay',intval($item_id)));
|
||||
\Zotlabs\Daemon\Master::Summon(array('Notifier','relay',intval($item_id)));
|
||||
$DR->addto_update('relayed');
|
||||
$result[] = $DR->get();
|
||||
}
|
||||
|
@ -2095,8 +2094,6 @@ class Libzot {
|
|||
return false;
|
||||
}
|
||||
|
||||
require_once('include/items.php');
|
||||
|
||||
if($item_found) {
|
||||
if(intval($r[0]['item_deleted'])) {
|
||||
logger('delete_imported_item: item was already deleted');
|
||||
|
@ -2140,7 +2137,7 @@ class Libzot {
|
|||
|
||||
foreach($deliveries as $d) {
|
||||
|
||||
$DR = new Zotlabs\Lib\DReport(z_root(),$sender['hash'],$d['hash'],$arr['mid']);
|
||||
$DR = new \Zotlabs\Lib\DReport(z_root(),$sender['hash'],$d['hash'],$arr['mid']);
|
||||
|
||||
$r = q("select * from channel where channel_hash = '%s' limit 1",
|
||||
dbesc($d['hash'])
|
||||
|
@ -3118,7 +3115,7 @@ class Libzot {
|
|||
$synchubs = array();
|
||||
|
||||
foreach($h as $x) {
|
||||
if($x['hubloc_host'] == App::get_hostname())
|
||||
if($x['hubloc_host'] == \App::get_hostname())
|
||||
continue;
|
||||
|
||||
$y = q("select site_dead from site where site_url = '%s' limit 1",
|
||||
|
@ -3226,7 +3223,7 @@ class Libzot {
|
|||
}
|
||||
|
||||
|
||||
Zotlabs\Daemon\Master::Summon(array('Deliver', $hash));
|
||||
\Zotlabs\Daemon\Master::Summon(array('Deliver', $hash));
|
||||
$total = $total - 1;
|
||||
|
||||
if($interval && $total)
|
||||
|
@ -3822,11 +3819,11 @@ class Libzot {
|
|||
// we should probably do this for all items, but usually we only send one.
|
||||
|
||||
if(array_key_exists('item',$arr) && is_array($arr['item'][0])) {
|
||||
$DR = new Zotlabs\Lib\DReport(z_root(),$d['hash'],$d['hash'],$arr['item'][0]['message_id'],'channel sync processed');
|
||||
$DR = new \Zotlabs\Lib\DReport(z_root(),$d['hash'],$d['hash'],$arr['item'][0]['message_id'],'channel sync processed');
|
||||
$DR->addto_recipient($channel['channel_name'] . ' <' . channel_reddress($channel) . '>');
|
||||
}
|
||||
else
|
||||
$DR = new Zotlabs\Lib\DReport(z_root(),$d['hash'],$d['hash'],'sync packet','channel sync delivered');
|
||||
$DR = new \Zotlabs\Lib\DReport(z_root(),$d['hash'],$d['hash'],'sync packet','channel sync delivered');
|
||||
|
||||
$result[] = $DR->get();
|
||||
}
|
||||
|
@ -4229,7 +4226,7 @@ class Libzot {
|
|||
|
||||
|
||||
$ret['site']['encryption'] = crypto_methods();
|
||||
$ret['site']['zot'] = Zotlabs\Lib\System::get_zot_revision();
|
||||
$ret['site']['zot'] = \Zotlabs\Lib\System::get_zot_revision();
|
||||
|
||||
// hide detailed site information if you're off the grid
|
||||
|
||||
|
@ -4277,8 +4274,8 @@ class Libzot {
|
|||
$ret['site']['sellpage'] = get_config('system','sellpage');
|
||||
$ret['site']['location'] = get_config('system','site_location');
|
||||
$ret['site']['realm'] = get_directory_realm();
|
||||
$ret['site']['project'] = Zotlabs\Lib\System::get_platform_name() . ' ' . Zotlabs\Lib\System::get_server_role();
|
||||
$ret['site']['version'] = Zotlabs\Lib\System::get_project_version();
|
||||
$ret['site']['project'] = \Zotlabs\Lib\System::get_platform_name() . ' ' . \Zotlabs\Lib\System::get_server_role();
|
||||
$ret['site']['version'] = \Zotlabs\Lib\System::get_project_version();
|
||||
|
||||
}
|
||||
|
||||
|
|
|
@ -4,7 +4,6 @@ namespace Zotlabs\Lib;
|
|||
|
||||
require_once('boot.php');
|
||||
require_once('include/text.php');
|
||||
require_once('include/items.php');
|
||||
|
||||
/**
|
||||
* A list of threads
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
<?php
|
||||
namespace Zotlabs\Module;
|
||||
|
||||
require_once('include/items.php');
|
||||
require_once('include/conversation.php');
|
||||
|
||||
class Block extends \Zotlabs\Web\Controller {
|
||||
|
|
|
@ -5,7 +5,7 @@ require_once('include/conversation.php');
|
|||
require_once('include/bbcode.php');
|
||||
require_once('include/datetime.php');
|
||||
require_once('include/event.php');
|
||||
require_once('include/items.php');
|
||||
|
||||
|
||||
|
||||
class Cal extends \Zotlabs\Web\Controller {
|
||||
|
|
|
@ -5,7 +5,6 @@ namespace Zotlabs\Module;
|
|||
use Zotlabs\Lib\Libzot;
|
||||
|
||||
require_once('include/contact_widgets.php');
|
||||
require_once('include/items.php');
|
||||
require_once("include/bbcode.php");
|
||||
require_once('include/security.php');
|
||||
require_once('include/conversation.php');
|
||||
|
|
|
@ -2,6 +2,8 @@
|
|||
|
||||
namespace Zotlabs\Module;
|
||||
|
||||
use Zotlabs\Lib\Libzot;
|
||||
|
||||
|
||||
require_once('include/bookmarks.php');
|
||||
|
||||
|
@ -74,7 +76,7 @@ class Chat extends \Zotlabs\Web\Controller {
|
|||
intval(local_channel())
|
||||
);
|
||||
|
||||
build_sync_packet(0, array('chatroom' => $x));
|
||||
Libzot::build_sync_packet(0, array('chatroom' => $x));
|
||||
|
||||
if($x)
|
||||
goaway(z_root() . '/chat/' . $channel['channel_address'] . '/' . $x[0]['cr_id']);
|
||||
|
|
|
@ -4,8 +4,6 @@ namespace Zotlabs\Module; /** @file */
|
|||
|
||||
|
||||
require_once('include/contact_widgets.php');
|
||||
require_once('include/items.php');
|
||||
|
||||
|
||||
|
||||
class Connect extends \Zotlabs\Web\Controller {
|
||||
|
|
|
@ -374,7 +374,7 @@ class Connedit extends \Zotlabs\Web\Controller {
|
|||
if($abconfig)
|
||||
$clone['abconfig'] = $abconfig;
|
||||
|
||||
build_sync_packet(0 /* use the current local_channel */, array('abook' => array($clone)));
|
||||
Libzot::build_sync_packet(0 /* use the current local_channel */, array('abook' => array($clone)));
|
||||
}
|
||||
|
||||
/* @brief Generate content of connection edit page
|
||||
|
@ -546,7 +546,7 @@ class Connedit extends \Zotlabs\Web\Controller {
|
|||
// PLACEHOLDER
|
||||
|
||||
contact_remove(local_channel(), $orig_record[0]['abook_id']);
|
||||
build_sync_packet(0 /* use the current local_channel */,
|
||||
Libzot::build_sync_packet(0 /* use the current local_channel */,
|
||||
array('abook' => array(array(
|
||||
'abook_xchan' => $orig_record[0]['abook_xchan'],
|
||||
'entry_deleted' => true))
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
<?php
|
||||
namespace Zotlabs\Module;
|
||||
|
||||
use Zotlabs\Lib\Libzot;
|
||||
|
||||
require_once('include/socgraph.php');
|
||||
require_once('include/selectors.php');
|
||||
|
@ -156,7 +157,7 @@ class Defperms extends \Zotlabs\Web\Controller {
|
|||
if($abconfig)
|
||||
$clone['abconfig'] = $abconfig;
|
||||
|
||||
build_sync_packet(0 /* use the current local_channel */, array('abook' => array($clone)));
|
||||
Libzot::build_sync_packet(0 /* use the current local_channel */, array('abook' => array($clone)));
|
||||
}
|
||||
|
||||
/* @brief Generate content of connection default permissions page
|
||||
|
|
|
@ -5,7 +5,6 @@ require_once("include/bbcode.php");
|
|||
require_once('include/security.php');
|
||||
require_once('include/conversation.php');
|
||||
require_once('include/acl_selectors.php');
|
||||
require_once('include/items.php');
|
||||
|
||||
|
||||
class Display extends \Zotlabs\Web\Controller {
|
||||
|
|
|
@ -3,7 +3,6 @@ namespace Zotlabs\Module; /** @file */
|
|||
|
||||
require_once('include/acl_selectors.php');
|
||||
require_once('include/crypto.php');
|
||||
require_once('include/items.php');
|
||||
require_once('include/taxonomy.php');
|
||||
require_once('include/conversation.php');
|
||||
|
||||
|
|
|
@ -1,11 +1,12 @@
|
|||
<?php
|
||||
namespace Zotlabs\Module;
|
||||
|
||||
use Zotlabs\Lib\Libzot;
|
||||
|
||||
require_once('include/conversation.php');
|
||||
require_once('include/bbcode.php');
|
||||
require_once('include/datetime.php');
|
||||
require_once('include/event.php');
|
||||
require_once('include/items.php');
|
||||
|
||||
|
||||
class Events extends \Zotlabs\Web\Controller {
|
||||
|
@ -232,7 +233,7 @@ class Events extends \Zotlabs\Web\Controller {
|
|||
intval($channel['channel_id'])
|
||||
);
|
||||
if($z) {
|
||||
build_sync_packet($channel['channel_id'],array('event_item' => array(encode_item($sync_item[0],true)),'event' => $z));
|
||||
Libzot::build_sync_packet($channel['channel_id'],array('event_item' => array(encode_item($sync_item[0],true)),'event' => $z));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -726,7 +727,7 @@ class Events extends \Zotlabs\Web\Controller {
|
|||
intval(local_channel())
|
||||
);
|
||||
$sync_event['event_deleted'] = 1;
|
||||
build_sync_packet(0,array('event' => array($sync_event)));
|
||||
Libzot::build_sync_packet(0,array('event' => array($sync_event)));
|
||||
|
||||
info( t('Event removed') . EOL);
|
||||
}
|
||||
|
|
|
@ -3,8 +3,6 @@
|
|||
namespace Zotlabs\Module;
|
||||
|
||||
|
||||
require_once('include/items.php');
|
||||
|
||||
class Feed extends \Zotlabs\Web\Controller {
|
||||
|
||||
function init() {
|
||||
|
|
|
@ -1,6 +1,8 @@
|
|||
<?php
|
||||
namespace Zotlabs\Module;
|
||||
|
||||
use Zotlabs\Lib\Libzot;
|
||||
|
||||
require_once('include/attach.php');
|
||||
require_once('include/channel.php');
|
||||
require_once('include/photos.php');
|
||||
|
@ -41,7 +43,7 @@ class File_upload extends \Zotlabs\Web\Controller {
|
|||
|
||||
$sync = attach_export_data($channel,$hash);
|
||||
if($sync) {
|
||||
build_sync_packet($channel['channel_id'],array('file' => array($sync)));
|
||||
Libzot::build_sync_packet($channel['channel_id'],array('file' => array($sync)));
|
||||
}
|
||||
goaway(z_root() . '/cloud/' . $channel['channel_address'] . '/' . $r['data']['display_path']);
|
||||
|
||||
|
@ -97,7 +99,7 @@ class File_upload extends \Zotlabs\Web\Controller {
|
|||
if($r['success']) {
|
||||
$sync = attach_export_data($channel,$r['data']['hash']);
|
||||
if($sync)
|
||||
build_sync_packet($channel['channel_id'],array('file' => array($sync)));
|
||||
Libzot::build_sync_packet($channel['channel_id'],array('file' => array($sync)));
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
@ -3,8 +3,6 @@ namespace Zotlabs\Module;
|
|||
|
||||
require_once('include/security.php');
|
||||
require_once('include/bbcode.php');
|
||||
require_once('include/items.php');
|
||||
|
||||
|
||||
|
||||
class Filer extends \Zotlabs\Web\Controller {
|
||||
|
|
|
@ -5,6 +5,9 @@ namespace Zotlabs\Module;
|
|||
*
|
||||
*/
|
||||
|
||||
|
||||
use Zotlabs\Lib\Libzot;
|
||||
|
||||
class Filestorage extends \Zotlabs\Web\Controller {
|
||||
|
||||
function post() {
|
||||
|
@ -124,7 +127,7 @@ class Filestorage extends \Zotlabs\Web\Controller {
|
|||
if(! $admin_delete) {
|
||||
$sync = attach_export_data($channel, $f['hash'], true);
|
||||
if($sync) {
|
||||
build_sync_packet($channel['channel_id'], array('file' => array($sync)));
|
||||
Libzot::build_sync_packet($channel['channel_id'], array('file' => array($sync)));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -1,6 +1,8 @@
|
|||
<?php
|
||||
namespace Zotlabs\Module;
|
||||
|
||||
use Zotlabs\Lib\Libzot;
|
||||
|
||||
|
||||
require_once('include/follow.php');
|
||||
|
||||
|
@ -49,7 +51,7 @@ class Follow extends \Zotlabs\Web\Controller {
|
|||
if($abconfig)
|
||||
$clone['abconfig'] = $abconfig;
|
||||
|
||||
build_sync_packet(0 /* use the current local_channel */, array('abook' => array($clone)), true);
|
||||
Libzot::build_sync_packet(0 /* use the current local_channel */, array('abook' => array($clone)), true);
|
||||
|
||||
$can_view_stream = their_perms_contains($channel['channel_id'],$clone['abook_xchan'],'view_stream');
|
||||
|
||||
|
|
|
@ -1,6 +1,9 @@
|
|||
<?php
|
||||
namespace Zotlabs\Module;
|
||||
|
||||
use Zotlabs\Lib\Libzot;
|
||||
|
||||
|
||||
require_once('include/group.php');
|
||||
|
||||
|
||||
|
@ -56,7 +59,7 @@ class Group extends \Zotlabs\Web\Controller {
|
|||
);
|
||||
if($r)
|
||||
info( t('Privacy group updated.') . EOL );
|
||||
build_sync_packet(local_channel(),null,true);
|
||||
Libzot::build_sync_packet(local_channel(),null,true);
|
||||
}
|
||||
|
||||
goaway(z_root() . '/group/' . argv(1) . '/' . argv(2));
|
||||
|
|
|
@ -3,9 +3,8 @@ namespace Zotlabs\Module;
|
|||
|
||||
use Zotlabs\Lib\Libzot;
|
||||
|
||||
require_once('include/items.php');
|
||||
require_once('include/conversation.php');
|
||||
|
||||
require_once('include/conversation.php');
|
||||
|
||||
|
||||
class Home extends \Zotlabs\Web\Controller {
|
||||
|
|
|
@ -5,7 +5,6 @@ require_once("include/bbcode.php");
|
|||
require_once('include/security.php');
|
||||
require_once('include/conversation.php');
|
||||
require_once('include/acl_selectors.php');
|
||||
require_once('include/items.php');
|
||||
|
||||
|
||||
class Hq extends \Zotlabs\Web\Controller {
|
||||
|
|
|
@ -17,8 +17,9 @@ namespace Zotlabs\Module;
|
|||
*
|
||||
*/
|
||||
|
||||
use Zotlabs\Lib\Libzot;
|
||||
|
||||
require_once('include/crypto.php');
|
||||
require_once('include/items.php');
|
||||
require_once('include/attach.php');
|
||||
require_once('include/bbcode.php');
|
||||
require_once('include/security.php');
|
||||
|
@ -69,7 +70,6 @@ class Item extends \Zotlabs\Web\Controller {
|
|||
}
|
||||
|
||||
if(x($_REQUEST,'dropitems')) {
|
||||
require_once('include/items.php');
|
||||
$arr_drop = explode(',',$_REQUEST['dropitems']);
|
||||
drop_items($arr_drop);
|
||||
$json = array('success' => 1);
|
||||
|
@ -918,7 +918,7 @@ logger('linkify: ' . print_r($results,true));
|
|||
if($r) {
|
||||
xchan_query($r);
|
||||
$sync_item = fetch_post_tags($r);
|
||||
build_sync_packet($profile_uid,array('item' => array(encode_item($sync_item[0],true))));
|
||||
Libzot::build_sync_packet($profile_uid,array('item' => array(encode_item($sync_item[0],true))));
|
||||
}
|
||||
}
|
||||
if(! $nopush)
|
||||
|
@ -1027,7 +1027,7 @@ logger('linkify: ' . print_r($results,true));
|
|||
if($r) {
|
||||
xchan_query($r);
|
||||
$sync_item = fetch_post_tags($r);
|
||||
build_sync_packet($profile_uid,array('item' => array(encode_item($sync_item[0],true))));
|
||||
Libzot::build_sync_packet($profile_uid,array('item' => array(encode_item($sync_item[0],true))));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1073,9 +1073,6 @@ logger('linkify: ' . print_r($results,true));
|
|||
|
||||
if((argc() == 3) && (argv(1) === 'drop') && intval(argv(2))) {
|
||||
|
||||
require_once('include/items.php');
|
||||
|
||||
|
||||
$i = q("select id, uid, item_origin, author_xchan, owner_xchan, source_xchan, item_type from item where id = %d limit 1",
|
||||
intval(argv(2))
|
||||
);
|
||||
|
@ -1129,7 +1126,7 @@ logger('linkify: ' . print_r($results,true));
|
|||
if($r) {
|
||||
xchan_query($r);
|
||||
$sync_item = fetch_post_tags($r);
|
||||
build_sync_packet($i[0]['uid'],array('item' => array(encode_item($sync_item[0],true))));
|
||||
Libzot::build_sync_packet($i[0]['uid'],array('item' => array(encode_item($sync_item[0],true))));
|
||||
}
|
||||
|
||||
if($complex) {
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
<?php
|
||||
namespace Zotlabs\Module;
|
||||
|
||||
use Zotlabs\Lib\Libzot;
|
||||
|
||||
require_once('include/security.php');
|
||||
require_once('include/bbcode.php');
|
||||
require_once('include/items.php');
|
||||
|
||||
|
||||
|
||||
class Like extends \Zotlabs\Web\Controller {
|
||||
|
@ -228,7 +228,7 @@ class Like extends \Zotlabs\Web\Controller {
|
|||
|
||||
if($z) {
|
||||
$z[0]['deleted'] = 1;
|
||||
build_sync_packet($ch[0]['channel_id'],array('likes' => $z));
|
||||
Libzot::build_sync_packet($ch[0]['channel_id'],array('likes' => $z));
|
||||
|
||||
q("delete from likes where id = %d",
|
||||
intval($z[0]['id'])
|
||||
|
@ -342,7 +342,6 @@ class Like extends \Zotlabs\Web\Controller {
|
|||
|
||||
if($r) {
|
||||
// already liked it. Drop that item.
|
||||
require_once('include/items.php');
|
||||
foreach($r as $rr) {
|
||||
drop_item($rr['id'],false,DROPITEM_PHASE1);
|
||||
// set the changed timestamp on the parent so we'll see the update without a page reload
|
||||
|
@ -553,7 +552,7 @@ class Like extends \Zotlabs\Web\Controller {
|
|||
dbesc($obj_id)
|
||||
);
|
||||
if($r)
|
||||
build_sync_packet($ch[0]['channel_id'],array('likes' => $r));
|
||||
Libzot::build_sync_packet($ch[0]['channel_id'],array('likes' => $r));
|
||||
|
||||
}
|
||||
|
||||
|
|
|
@ -110,7 +110,7 @@ class Mail extends \Zotlabs\Web\Controller {
|
|||
|
||||
if($ret['success']) {
|
||||
xchan_mail_query($ret['mail']);
|
||||
build_sync_packet(0,array('conv' => array($ret['conv']),'mail' => array(encode_mail($ret['mail'],true))));
|
||||
Libzot::build_sync_packet(0,array('conv' => array($ret['conv']),'mail' => array(encode_mail($ret['mail'],true))));
|
||||
}
|
||||
else {
|
||||
notice($ret['message']);
|
||||
|
@ -188,7 +188,7 @@ class Mail extends \Zotlabs\Web\Controller {
|
|||
intval(local_channel())
|
||||
);
|
||||
if($x) {
|
||||
build_sync_packet(local_channel(),array('mail' => encode_mail($x[0],true)));
|
||||
Libzot::build_sync_packet(local_channel(),array('mail' => encode_mail($x[0],true)));
|
||||
}
|
||||
|
||||
\Zotlabs\Daemon\Master::Summon(array('Notifier','mail',intval(argv(3))));
|
||||
|
|
|
@ -2,6 +2,8 @@
|
|||
|
||||
namespace Zotlabs\Module;
|
||||
|
||||
use Zotlabs\Lib\Libzot;
|
||||
|
||||
require_once('include/conversation.php');
|
||||
|
||||
|
||||
|
@ -77,7 +79,7 @@ class Moderate extends \Zotlabs\Web\Controller {
|
|||
if($r) {
|
||||
xchan_query($r);
|
||||
$sync_item = fetch_post_tags($r);
|
||||
build_sync_packet(local_channel(),array('item' => array(encode_item($sync_item[0],true))));
|
||||
Libzot::build_sync_packet(local_channel(),array('item' => array(encode_item($sync_item[0],true))));
|
||||
}
|
||||
if($action === 'approve') {
|
||||
\Zotlabs\Daemon\Master::Summon(array('Notifier', 'comment-new', $post_id));
|
||||
|
|
|
@ -3,8 +3,6 @@ namespace Zotlabs\Module;
|
|||
|
||||
require_once('include/security.php');
|
||||
require_once('include/bbcode.php');
|
||||
require_once('include/items.php');
|
||||
|
||||
|
||||
|
||||
class Mood extends \Zotlabs\Web\Controller {
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
<?php
|
||||
namespace Zotlabs\Module;
|
||||
|
||||
require_once('include/items.php');
|
||||
require_once('include/group.php');
|
||||
require_once('include/contact_widgets.php');
|
||||
require_once('include/conversation.php');
|
||||
|
@ -462,9 +461,7 @@ class Network extends \Zotlabs\Web\Controller {
|
|||
$net_query2
|
||||
ORDER BY item.received DESC $pager_sql "
|
||||
);
|
||||
|
||||
require_once('include/items.php');
|
||||
|
||||
|
||||
xchan_query($items);
|
||||
|
||||
$items = fetch_post_tags($items,true);
|
||||
|
|
|
@ -1,6 +1,8 @@
|
|||
<?php
|
||||
namespace Zotlabs\Module; /** @file */
|
||||
|
||||
use Zotlabs\Lib\Libzot;
|
||||
|
||||
|
||||
class Notes extends \Zotlabs\Web\Controller {
|
||||
|
||||
|
@ -29,7 +31,7 @@ class Notes extends \Zotlabs\Web\Controller {
|
|||
|
||||
if((argc() > 1) && (argv(1) === 'sync')) {
|
||||
require_once('include/zot.php');
|
||||
build_sync_packet();
|
||||
Libzot::build_sync_packet();
|
||||
}
|
||||
|
||||
logger('notes saved.', LOGGER_DEBUG);
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
<?php
|
||||
namespace Zotlabs\Module;
|
||||
|
||||
require_once('include/items.php');
|
||||
|
||||
require_once('include/conversation.php');
|
||||
|
||||
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
<?php
|
||||
namespace Zotlabs\Module;
|
||||
|
||||
use Zotlabs\Lib\Libzot;
|
||||
|
||||
|
||||
|
||||
|
@ -32,7 +33,7 @@ class Pconfig extends \Zotlabs\Web\Controller {
|
|||
}
|
||||
|
||||
set_pconfig(local_channel(),$cat,$k,$v);
|
||||
build_sync_packet();
|
||||
Libzot::build_sync_packet();
|
||||
|
||||
goaway(z_root() . '/pconfig/' . $cat . '/' . $k);
|
||||
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
<?php
|
||||
namespace Zotlabs\Module;
|
||||
|
||||
use Zotlabs\Lib\Libzot;
|
||||
|
||||
class Pdledit extends \Zotlabs\Web\Controller {
|
||||
|
||||
|
@ -17,7 +18,7 @@ class Pdledit extends \Zotlabs\Web\Controller {
|
|||
goaway(z_root() . '/pdledit');
|
||||
}
|
||||
set_pconfig(local_channel(),'system','mod_' . $_REQUEST['module'] . '.pdl',escape_tags($_REQUEST['content']));
|
||||
build_sync_packet();
|
||||
Libzot::build_sync_packet();
|
||||
info( t('Layout updated.') . EOL);
|
||||
goaway(z_root() . '/pdledit/' . $_REQUEST['module']);
|
||||
}
|
||||
|
|
|
@ -1,9 +1,10 @@
|
|||
<?php
|
||||
namespace Zotlabs\Module;
|
||||
|
||||
use Zotlabs\Lib\Libzot;
|
||||
|
||||
require_once('include/photo/photo_driver.php');
|
||||
require_once('include/photos.php');
|
||||
require_once('include/items.php');
|
||||
require_once('include/acl_selectors.php');
|
||||
require_once('include/bbcode.php');
|
||||
require_once('include/security.php');
|
||||
|
@ -162,7 +163,7 @@ class Photos extends \Zotlabs\Web\Controller {
|
|||
$sync = attach_export_data(\App::$data['channel'],$folder_hash, true);
|
||||
|
||||
if($sync)
|
||||
build_sync_packet($page_owner_uid,array('file' => array($sync)));
|
||||
Libzot::build_sync_packet($page_owner_uid,array('file' => array($sync)));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -189,7 +190,7 @@ class Photos extends \Zotlabs\Web\Controller {
|
|||
$sync = attach_export_data(\App::$data['channel'],$r[0]['resource_id'], true);
|
||||
|
||||
if($sync)
|
||||
build_sync_packet($page_owner_uid,array('file' => array($sync)));
|
||||
Libzot::build_sync_packet($page_owner_uid,array('file' => array($sync)));
|
||||
}
|
||||
elseif(is_site_admin()) {
|
||||
// If the admin deletes a photo, don't sync
|
||||
|
@ -210,7 +211,7 @@ class Photos extends \Zotlabs\Web\Controller {
|
|||
|
||||
$sync = attach_export_data(\App::$data['channel'],argv(2),true);
|
||||
if($sync)
|
||||
build_sync_packet($page_owner_uid,array('file' => array($sync)));
|
||||
Libzot::build_sync_packet($page_owner_uid,array('file' => array($sync)));
|
||||
|
||||
if(! ($_POST['desc'] && $_POST['newtag']))
|
||||
goaway(z_root() . '/' . $_SESSION['photo_return']);
|
||||
|
@ -449,7 +450,7 @@ class Photos extends \Zotlabs\Web\Controller {
|
|||
$sync = attach_export_data(\App::$data['channel'],$resource_id);
|
||||
|
||||
if($sync)
|
||||
build_sync_packet($page_owner_uid,array('file' => array($sync)));
|
||||
Libzot::build_sync_packet($page_owner_uid,array('file' => array($sync)));
|
||||
|
||||
goaway(z_root() . '/' . $_SESSION['photo_return']);
|
||||
return; // NOTREACHED
|
||||
|
|
|
@ -15,8 +15,6 @@ namespace Zotlabs\Module; /** @file */
|
|||
*
|
||||
*/
|
||||
|
||||
require_once('include/items.php');
|
||||
|
||||
|
||||
class Poke extends \Zotlabs\Web\Controller {
|
||||
|
||||
|
|
|
@ -2,7 +2,6 @@
|
|||
namespace Zotlabs\Module; /** @file */
|
||||
|
||||
require_once('include/contact_widgets.php');
|
||||
require_once('include/items.php');
|
||||
require_once("include/bbcode.php");
|
||||
require_once('include/security.php');
|
||||
require_once('include/conversation.php');
|
||||
|
|
|
@ -1,6 +1,9 @@
|
|||
<?php
|
||||
namespace Zotlabs\Module;
|
||||
|
||||
|
||||
use Zotlabs\Lib\Libzot;
|
||||
|
||||
/*
|
||||
* @file Profile_photo.php
|
||||
* @brief Module-file with functions for handling of profile-photos
|
||||
|
@ -209,7 +212,7 @@ class Profile_photo extends \Zotlabs\Web\Controller {
|
|||
|
||||
$sync = attach_export_data($channel,$base_image['resource_id']);
|
||||
if($sync)
|
||||
build_sync_packet($channel['channel_id'],array('file' => array($sync), 'profile' => $sync_profiles));
|
||||
Libzot::build_sync_packet($channel['channel_id'],array('file' => array($sync), 'profile' => $sync_profiles));
|
||||
|
||||
|
||||
// Similarly, tell the nav bar to bypass the cache and update the avatar image.
|
||||
|
@ -374,7 +377,7 @@ class Profile_photo extends \Zotlabs\Web\Controller {
|
|||
|
||||
$sync = attach_export_data($channel,$resource_id);
|
||||
if($sync)
|
||||
build_sync_packet($channel['channel_id'],array('file' => array($sync)));
|
||||
Libzot::build_sync_packet($channel['channel_id'],array('file' => array($sync)));
|
||||
|
||||
|
||||
\Zotlabs\Daemon\Master::Summon(array('Directory',local_channel()));
|
||||
|
|
|
@ -1,6 +1,8 @@
|
|||
<?php
|
||||
namespace Zotlabs\Module;
|
||||
|
||||
use Zotlabs\Lib\Libzot;
|
||||
|
||||
require_once('include/channel.php');
|
||||
require_once('include/selectors.php');
|
||||
|
||||
|
@ -599,7 +601,7 @@ class Profiles extends \Zotlabs\Web\Controller {
|
|||
);
|
||||
if($r) {
|
||||
require_once('include/zot.php');
|
||||
build_sync_packet(local_channel(),array('profile' => $r));
|
||||
Libzot::build_sync_packet(local_channel(),array('profile' => $r));
|
||||
}
|
||||
|
||||
$channel = \App::get_channel();
|
||||
|
|
|
@ -3,7 +3,6 @@ namespace Zotlabs\Module; /** @file */
|
|||
|
||||
require_once('include/acl_selectors.php');
|
||||
require_once('include/crypto.php');
|
||||
require_once('include/items.php');
|
||||
require_once('include/taxonomy.php');
|
||||
require_once('include/conversation.php');
|
||||
require_once('include/bookmarks.php');
|
||||
|
|
|
@ -1,6 +1,10 @@
|
|||
<?php
|
||||
namespace Zotlabs\Module;
|
||||
|
||||
require_once("include/bbcode.php");
|
||||
require_once('include/security.php');
|
||||
require_once('include/conversation.php');
|
||||
|
||||
|
||||
class Search extends \Zotlabs\Web\Controller {
|
||||
|
||||
|
@ -24,10 +28,7 @@ class Search extends \Zotlabs\Web\Controller {
|
|||
|
||||
nav_set_selected('Search');
|
||||
|
||||
require_once("include/bbcode.php");
|
||||
require_once('include/security.php');
|
||||
require_once('include/conversation.php');
|
||||
require_once('include/items.php');
|
||||
|
||||
|
||||
$format = (($_REQUEST['format']) ? $_REQUEST['format'] : '');
|
||||
if($format !== '') {
|
||||
|
|
|
@ -2,6 +2,8 @@
|
|||
|
||||
namespace Zotlabs\Module\Settings;
|
||||
|
||||
use Zotlabs\Lib\Libzot;
|
||||
|
||||
require_once('include/selectors.php');
|
||||
|
||||
|
||||
|
@ -290,7 +292,7 @@ class Channel {
|
|||
|
||||
\Zotlabs\Daemon\Master::Summon(array('Directory',local_channel()));
|
||||
|
||||
build_sync_packet();
|
||||
Libzot::build_sync_packet();
|
||||
|
||||
|
||||
if($email_changed && \App::$config['system']['register_policy'] == REGISTER_VERIFY) {
|
||||
|
|
|
@ -2,6 +2,8 @@
|
|||
|
||||
namespace Zotlabs\Module\Settings;
|
||||
|
||||
use Zotlabs\Lib\Libzot;
|
||||
|
||||
|
||||
class Display {
|
||||
|
||||
|
@ -89,7 +91,7 @@ class Display {
|
|||
);
|
||||
|
||||
call_hooks('display_settings_post', $_POST);
|
||||
build_sync_packet();
|
||||
Libzot::build_sync_packet();
|
||||
goaway(z_root() . '/settings/display' );
|
||||
return; // NOTREACHED
|
||||
}
|
||||
|
|
|
@ -2,6 +2,8 @@
|
|||
|
||||
namespace Zotlabs\Module\Settings;
|
||||
|
||||
use Zotlabs\Lib\Libzot;
|
||||
|
||||
|
||||
class Featured {
|
||||
|
||||
|
@ -24,7 +26,7 @@ class Featured {
|
|||
|
||||
}
|
||||
|
||||
build_sync_packet();
|
||||
Libzot::build_sync_packet();
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
|
||||
namespace Zotlabs\Module\Settings;
|
||||
|
||||
use Zotlabs\Lib\Libzot;
|
||||
|
||||
class Features {
|
||||
|
||||
|
@ -19,7 +20,7 @@ class Features {
|
|||
set_pconfig(local_channel(),'feature', $k, '');
|
||||
}
|
||||
}
|
||||
build_sync_packet();
|
||||
Libzot::build_sync_packet();
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
|
||||
namespace Zotlabs\Module\Settings;
|
||||
|
||||
use Zotlabs\Lib\Libzot;
|
||||
|
||||
|
||||
class Permcats {
|
||||
|
@ -37,7 +38,7 @@ class Permcats {
|
|||
|
||||
\Zotlabs\Lib\Permcat::update(local_channel(),$name,$pcarr);
|
||||
|
||||
build_sync_packet();
|
||||
Libzot::build_sync_packet();
|
||||
|
||||
info( t('Permission category saved.') . EOL);
|
||||
|
||||
|
@ -58,7 +59,7 @@ class Permcats {
|
|||
|
||||
if(argc() > 3 && argv(3) === 'drop') {
|
||||
\Zotlabs\Lib\Permcat::delete(local_channel(),$name);
|
||||
build_sync_packet();
|
||||
Libzot::build_sync_packet();
|
||||
json_return_and_die([ 'success' => true ]);
|
||||
}
|
||||
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
<?php
|
||||
namespace Zotlabs\Module;
|
||||
|
||||
use Zotlabs\Lib\Libzot;
|
||||
|
||||
|
||||
class Starred extends \Zotlabs\Web\Controller {
|
||||
|
@ -37,7 +38,7 @@ class Starred extends \Zotlabs\Web\Controller {
|
|||
if($r) {
|
||||
xchan_query($r);
|
||||
$sync_item = fetch_post_tags($r);
|
||||
build_sync_packet(local_channel(),[
|
||||
Libzot::build_sync_packet(local_channel(),[
|
||||
'item' => [
|
||||
encode_item($sync_item[0],true)
|
||||
]
|
||||
|
|
|
@ -3,7 +3,6 @@ namespace Zotlabs\Module;
|
|||
|
||||
require_once('include/security.php');
|
||||
require_once('include/bbcode.php');
|
||||
require_once('include/items.php');
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -1,9 +1,11 @@
|
|||
<?php
|
||||
namespace Zotlabs\Module;
|
||||
|
||||
use Zotlabs\Lib\Libzot;
|
||||
|
||||
require_once('include/security.php');
|
||||
require_once('include/bbcode.php');
|
||||
require_once('include/items.php');
|
||||
|
||||
|
||||
|
||||
|
||||
|
@ -149,7 +151,7 @@ class Tagger extends \Zotlabs\Web\Controller {
|
|||
$ret = post_activity_item($arr);
|
||||
|
||||
if($ret['success']) {
|
||||
build_sync_packet(local_channel(),
|
||||
Libzot::build_sync_packet(local_channel(),
|
||||
[
|
||||
'item' => [ encode_item($ret['activity'],true) ]
|
||||
]
|
||||
|
|
|
@ -5,7 +5,9 @@
|
|||
|
||||
namespace Zotlabs\Module;
|
||||
|
||||
require_once('include/items.php');
|
||||
|
||||
use Zotlabs\Lib\Libzot;
|
||||
|
||||
require_once('include/security.php');
|
||||
require_once('include/selectors.php');
|
||||
require_once('include/acl_selectors.php');
|
||||
|
@ -124,7 +126,7 @@ class Thing extends \Zotlabs\Web\Controller {
|
|||
dbesc($term_hash)
|
||||
);
|
||||
if($r) {
|
||||
build_sync_packet(0, array('obj' => $r));
|
||||
Libzot::build_sync_packet(0, array('obj' => $r));
|
||||
}
|
||||
|
||||
return;
|
||||
|
@ -180,7 +182,7 @@ class Thing extends \Zotlabs\Web\Controller {
|
|||
dbesc($hash)
|
||||
);
|
||||
if($r) {
|
||||
build_sync_packet(0, array('obj' => $r));
|
||||
Libzot::build_sync_packet(0, array('obj' => $r));
|
||||
}
|
||||
|
||||
if($activity) {
|
||||
|
@ -353,7 +355,7 @@ class Thing extends \Zotlabs\Web\Controller {
|
|||
|
||||
$r[0]['obj_deleted'] = 1;
|
||||
|
||||
build_sync_packet(0,array('obj' => $r));
|
||||
Libzot::build_sync_packet(0,array('obj' => $r));
|
||||
|
||||
return $o;
|
||||
}
|
||||
|
|
|
@ -1,6 +1,8 @@
|
|||
<?php
|
||||
namespace Zotlabs\Module;
|
||||
|
||||
use Zotlabs\Lib\Libzot;
|
||||
|
||||
require_once('include/attach.php');
|
||||
require_once('include/photos.php');
|
||||
|
||||
|
@ -102,7 +104,7 @@ class Wall_attach extends \Zotlabs\Web\Controller {
|
|||
|
||||
$sync = attach_export_data($channel,$r['data']['hash']);
|
||||
if($sync) {
|
||||
build_sync_packet($channel['channel_id'],array('file' => array($sync)));
|
||||
Libzot::build_sync_packet($channel['channel_id'],array('file' => array($sync)));
|
||||
}
|
||||
|
||||
if($using_api)
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
<?php
|
||||
namespace Zotlabs\Module;
|
||||
|
||||
require_once('include/items.php');
|
||||
|
||||
|
||||
class Zotfeed extends \Zotlabs\Web\Controller {
|
||||
|
|
|
@ -3,6 +3,7 @@
|
|||
namespace Zotlabs\Storage;
|
||||
|
||||
use Sabre\DAV;
|
||||
use Zotlabs\Lib\Libzot;
|
||||
|
||||
/**
|
||||
* @brief RedDirectory class.
|
||||
|
@ -179,7 +180,7 @@ class Directory extends DAV\Node implements DAV\ICollection, DAV\IQuota, DAV\IMo
|
|||
if ($ch) {
|
||||
$sync = attach_export_data($ch, $this->folder_hash);
|
||||
if ($sync)
|
||||
build_sync_packet($ch['channel_id'], array('file' => array($sync)));
|
||||
Libzot::build_sync_packet($ch['channel_id'], array('file' => array($sync)));
|
||||
}
|
||||
|
||||
$this->red_path = $new_path;
|
||||
|
@ -368,7 +369,7 @@ class Directory extends DAV\Node implements DAV\ICollection, DAV\IQuota, DAV\IMo
|
|||
$sync = attach_export_data($c[0], $hash);
|
||||
|
||||
if ($sync)
|
||||
build_sync_packet($c[0]['channel_id'], array('file' => array($sync)));
|
||||
Libzot::build_sync_packet($c[0]['channel_id'], array('file' => array($sync)));
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -401,7 +402,7 @@ class Directory extends DAV\Node implements DAV\ICollection, DAV\IQuota, DAV\IMo
|
|||
logger('createDirectory: attach_export_data returns $sync:' . print_r($sync, true), LOGGER_DEBUG);
|
||||
|
||||
if($sync) {
|
||||
build_sync_packet($r[0]['channel_id'], array('file' => array($sync)));
|
||||
Libzot::build_sync_packet($r[0]['channel_id'], array('file' => array($sync)));
|
||||
}
|
||||
}
|
||||
else {
|
||||
|
@ -432,7 +433,7 @@ class Directory extends DAV\Node implements DAV\ICollection, DAV\IQuota, DAV\IMo
|
|||
if ($ch) {
|
||||
$sync = attach_export_data($ch, $this->folder_hash, true);
|
||||
if ($sync)
|
||||
build_sync_packet($ch['channel_id'], array('file' => array($sync)));
|
||||
Libzot::build_sync_packet($ch['channel_id'], array('file' => array($sync)));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -3,6 +3,7 @@
|
|||
namespace Zotlabs\Storage;
|
||||
|
||||
use Sabre\DAV;
|
||||
use Zotlabs\Lib\Libzot;
|
||||
|
||||
/**
|
||||
* @brief This class represents a file in DAV.
|
||||
|
@ -106,7 +107,7 @@ class File extends DAV\Node implements DAV\IFile {
|
|||
if($ch) {
|
||||
$sync = attach_export_data($ch,$this->data['hash']);
|
||||
if($sync)
|
||||
build_sync_packet($ch['channel_id'],array('file' => array($sync)));
|
||||
Libzot::build_sync_packet($ch['channel_id'],array('file' => array($sync)));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -254,7 +255,7 @@ class File extends DAV\Node implements DAV\IFile {
|
|||
$sync = attach_export_data($c[0],$this->data['hash']);
|
||||
|
||||
if($sync)
|
||||
build_sync_packet($c[0]['channel_id'],array('file' => array($sync)));
|
||||
Libzot::build_sync_packet($c[0]['channel_id'],array('file' => array($sync)));
|
||||
|
||||
}
|
||||
|
||||
|
@ -378,7 +379,7 @@ class File extends DAV\Node implements DAV\IFile {
|
|||
if($ch) {
|
||||
$sync = attach_export_data($ch, $this->data['hash'], true);
|
||||
if($sync)
|
||||
build_sync_packet($ch['channel_id'], array('file' => array($sync)));
|
||||
Libzot::build_sync_packet($ch['channel_id'], array('file' => array($sync)));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -191,7 +191,7 @@ class Zot6Handler implements IHandler {
|
|||
* invoke delivery to send out the notify packet
|
||||
*/
|
||||
|
||||
Zotlabs\Daemon\Master::Summon(array('Deliver', $hash));
|
||||
\Zotlabs\Daemon\Master::Summon(array('Deliver', $hash));
|
||||
}
|
||||
}
|
||||
$ret['success'] = true;
|
||||
|
|
2
boot.php
2
boot.php
|
@ -50,7 +50,7 @@ require_once('include/xchan.php');
|
|||
require_once('include/hubloc.php');
|
||||
require_once('include/attach.php');
|
||||
require_once('include/bbcode.php');
|
||||
|
||||
require_once('include/items.php');
|
||||
|
||||
define ( 'PLATFORM_NAME', 'hubzilla' );
|
||||
|
||||
|
|
|
@ -8,8 +8,6 @@ function profile_activity($changed, $value) {
|
|||
if(! get_pconfig(local_channel(),'system','post_profilechange'))
|
||||
return;
|
||||
|
||||
require_once('include/items.php');
|
||||
|
||||
$self = App::get_channel();
|
||||
|
||||
if(! count($self))
|
||||
|
|
|
@ -1,13 +1,11 @@
|
|||
<?php /** @file */
|
||||
|
||||
require_once("include/bbcode.php");
|
||||
require_once("include/datetime.php");
|
||||
require_once("include/conversation.php");
|
||||
require_once("include/oauth.php");
|
||||
require_once("include/html2plain.php");
|
||||
require_once('include/security.php');
|
||||
require_once('include/photos.php');
|
||||
require_once('include/items.php');
|
||||
require_once('include/attach.php');
|
||||
require_once('include/api_auth.php');
|
||||
require_once('include/api_zot.php');
|
||||
|
|
|
@ -11,6 +11,8 @@
|
|||
* @todo Also an 'append' option to the storage function might be a useful addition.
|
||||
*/
|
||||
|
||||
use Zotlabs\Lib\Libzot;
|
||||
|
||||
require_once('include/permissions.php');
|
||||
require_once('include/security.php');
|
||||
require_once('include/group.php');
|
||||
|
@ -1008,7 +1010,7 @@ function attach_store($channel, $observer_hash, $options = '', $arr = null) {
|
|||
$sync = attach_export_data($channel,$hash);
|
||||
|
||||
if($sync)
|
||||
build_sync_packet($channel['channel_id'],array('file' => array($sync)));
|
||||
Libzot::build_sync_packet($channel['channel_id'],array('file' => array($sync)));
|
||||
}
|
||||
|
||||
if($notify) {
|
||||
|
@ -1395,7 +1397,7 @@ function attach_change_permissions($channel_id, $resource, $allow_cid, $allow_gi
|
|||
$data = attach_export_data($channel,$resource);
|
||||
|
||||
if($data)
|
||||
build_sync_packet($channel['channel_id'],array('file' => array($data)));
|
||||
Libzot::build_sync_packet($channel['channel_id'],array('file' => array($data)));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1711,8 +1713,6 @@ function pipe_streams($in, $out, $bufsize = 16384) {
|
|||
*/
|
||||
function file_activity($channel_id, $object, $allow_cid, $allow_gid, $deny_cid, $deny_gid, $verb, $notify) {
|
||||
|
||||
require_once('include/items.php');
|
||||
|
||||
$poster = App::get_observer();
|
||||
|
||||
//if we got no object something went wrong
|
||||
|
|
|
@ -569,7 +569,7 @@ function change_channel_keys($channel) {
|
|||
}
|
||||
}
|
||||
|
||||
build_sync_packet($channel['channel_id'], [ 'keychange' => $stored ]);
|
||||
Libzot::build_sync_packet($channel['channel_id'], [ 'keychange' => $stored ]);
|
||||
|
||||
$a = q("select * from abook where abook_xchan = '%s' and abook_self = 1",
|
||||
dbesc($stored['old_hash'])
|
||||
|
@ -2010,7 +2010,7 @@ function profiles_build_sync($channel_id,$send = true) {
|
|||
);
|
||||
if($r) {
|
||||
if($send) {
|
||||
build_sync_packet($channel_id,array('profile' => $r));
|
||||
Libzot::build_sync_packet($channel_id,array('profile' => $r));
|
||||
}
|
||||
else {
|
||||
return $r;
|
||||
|
|
|
@ -1,7 +1,5 @@
|
|||
<?php /** @file */
|
||||
|
||||
require_once('include/items.php');
|
||||
|
||||
|
||||
function item_extract_images($body) {
|
||||
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
<?php /** @file */
|
||||
|
||||
use Zotlabs\Lib\Libzot;
|
||||
|
||||
|
||||
function group_add($uid,$name,$public = 0) {
|
||||
|
||||
|
@ -44,7 +46,7 @@ function group_add($uid,$name,$public = 0) {
|
|||
$ret = $r;
|
||||
}
|
||||
|
||||
build_sync_packet($uid,null,true);
|
||||
Libzot::build_sync_packet($uid,null,true);
|
||||
|
||||
return $ret;
|
||||
}
|
||||
|
@ -113,7 +115,7 @@ function group_rmv($uid,$name) {
|
|||
|
||||
}
|
||||
|
||||
build_sync_packet($uid,null,true);
|
||||
Libzot::build_sync_packet($uid,null,true);
|
||||
|
||||
return $ret;
|
||||
}
|
||||
|
@ -155,7 +157,7 @@ function group_rmv_member($uid,$name,$member) {
|
|||
dbesc($member)
|
||||
);
|
||||
|
||||
build_sync_packet($uid,null,true);
|
||||
Libzot::build_sync_packet($uid,null,true);
|
||||
|
||||
return $r;
|
||||
|
||||
|
@ -186,7 +188,7 @@ function group_add_member($uid,$name,$member,$gid = 0) {
|
|||
dbesc($member)
|
||||
);
|
||||
|
||||
build_sync_packet($uid,null,true);
|
||||
Libzot::build_sync_packet($uid,null,true);
|
||||
|
||||
return $r;
|
||||
}
|
||||
|
|
|
@ -4,6 +4,8 @@
|
|||
* @brief Items related functions.
|
||||
*/
|
||||
|
||||
use Zotlabs\Lib\Libzot;
|
||||
|
||||
use Zotlabs\Lib as Zlib;
|
||||
|
||||
require_once('include/bbcode.php');
|
||||
|
@ -1534,7 +1536,7 @@ function item_sign(&$item) {
|
|||
if(! $r)
|
||||
return;
|
||||
|
||||
$item['sig'] = zot_sign($item['body'], $r[0]['channel_prvkey']);
|
||||
$item['sig'] = Libzot::sign($item['body'], $r[0]['channel_prvkey']);
|
||||
$item['item_verified'] = 1;
|
||||
}
|
||||
|
||||
|
@ -2755,7 +2757,7 @@ function item_community_tag($channel,$item) {
|
|||
$pitem = $items[0];
|
||||
$auth = get_iconfig($item,'system','communitytagauth');
|
||||
if($auth) {
|
||||
if(zot_verify('tagauth.' . $item['mid'],$auth,$pitem['owner']['xchan_pubkey']) || zot_verify('tagauth.' . $item['mid'],$auth,$pitem['author']['xchan_pubkey'])) {
|
||||
if(Libzot::verify('tagauth.' . $item['mid'],$auth,$pitem['owner']['xchan_pubkey']) || Libzot::verify('tagauth.' . $item['mid'],$auth,$pitem['author']['xchan_pubkey'])) {
|
||||
logger('tag_deliver: tagging the post: ' . $channel['channel_name']);
|
||||
$tag_the_post = true;
|
||||
}
|
||||
|
@ -2764,7 +2766,7 @@ function item_community_tag($channel,$item) {
|
|||
if(($pitem['owner_xchan'] === $channel['channel_hash']) && (! intval(get_pconfig($channel['channel_id'],'system','blocktags')))) {
|
||||
logger('tag_deliver: community tag recipient: ' . $channel['channel_name']);
|
||||
$tag_the_post = true;
|
||||
$sig = zot_sign('tagauth.' . $item['mid'],$channel['channel_prvkey']);
|
||||
$sig = Libzot::sign('tagauth.' . $item['mid'],$channel['channel_prvkey']);
|
||||
logger('tag_deliver: setting iconfig for ' . $item['id']);
|
||||
set_iconfig($item['id'],'system','communitytagauth',base64url_encode($sig),1);
|
||||
}
|
||||
|
@ -4527,7 +4529,7 @@ function sync_an_item($channel_id,$item_id) {
|
|||
if($r) {
|
||||
xchan_query($r);
|
||||
$sync_item = fetch_post_tags($r);
|
||||
build_sync_packet($channel_d,array('item' => array(encode_item($sync_item[0],true))));
|
||||
Libzot::build_sync_packet($channel_d,array('item' => array(encode_item($sync_item[0],true))));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -4728,7 +4730,7 @@ function item_create_edit_activity($post) {
|
|||
if($r) {
|
||||
xchan_query($r);
|
||||
$sync_item = fetch_post_tags($r);
|
||||
build_sync_packet($new_item['uid'],array('item' => array(encode_item($sync_item[0],true))));
|
||||
Libzot::build_sync_packet($new_item['uid'],array('item' => array(encode_item($sync_item[0],true))));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -1,5 +1,8 @@
|
|||
<?php /** @file */
|
||||
|
||||
|
||||
use Zotlabs\Lib\Libzot;
|
||||
|
||||
require_once('include/security.php');
|
||||
require_once('include/bbcode.php');
|
||||
|
||||
|
@ -400,7 +403,7 @@ function menu_sync_packet($uid,$observer_hash,$menu_id,$delete = false) {
|
|||
if($m) {
|
||||
if($delete)
|
||||
$m['menu_delete'] = 1;
|
||||
build_sync_packet($uid,array('menu' => array(menu_element($c,$m))));
|
||||
Libzot::build_sync_packet($uid,array('menu' => array(menu_element($c,$m))));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -2,6 +2,9 @@
|
|||
|
||||
/* Private Message backend API */
|
||||
|
||||
|
||||
use Zotlabs\Lib\Libzot;
|
||||
|
||||
require_once('include/crypto.php');
|
||||
require_once('include/attach.php');
|
||||
|
||||
|
@ -493,7 +496,7 @@ function private_messages_drop($channel_id, $messageitem_id, $drop_conversation
|
|||
intval($channel_id)
|
||||
);
|
||||
}
|
||||
build_sync_packet($channel_id,$m);
|
||||
Libzot::build_sync_packet($channel_id,$m);
|
||||
return true;
|
||||
}
|
||||
else {
|
||||
|
@ -503,7 +506,7 @@ function private_messages_drop($channel_id, $messageitem_id, $drop_conversation
|
|||
intval($messageitem_id),
|
||||
intval($channel_id)
|
||||
);
|
||||
build_sync_packet($channel_id,array('mail' => array(encode_mail($x,true))));
|
||||
Libzot::build_sync_packet($channel_id,array('mail' => array(encode_mail($x,true))));
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
|
|
|
@ -5,7 +5,6 @@
|
|||
*/
|
||||
|
||||
require_once('include/permissions.php');
|
||||
require_once('include/items.php');
|
||||
require_once('include/photo/photo_driver.php');
|
||||
require_once('include/text.php');
|
||||
|
||||
|
|
|
@ -1,5 +1,8 @@
|
|||
<?php /** @file */
|
||||
|
||||
use Zotlabs\Lib\Libzot;
|
||||
|
||||
|
||||
function update_queue_item($id, $add_priority = 0) {
|
||||
logger('queue: requeue item ' . $id,LOGGER_DEBUG);
|
||||
$x = q("select outq_created, outq_posturl from outq where outq_hash = '%s' limit 1",
|
||||
|
@ -245,12 +248,12 @@ function queue_deliver($outq, $immediate = false) {
|
|||
|
||||
$msg = $outq['outq_notify'];
|
||||
|
||||
$result = zot_zot($outq['outq_posturl'],$msg,$channel,$host_crypto);
|
||||
$result = Libzot::zot($outq['outq_posturl'],$msg,$channel,$host_crypto);
|
||||
|
||||
|
||||
if($result['success']) {
|
||||
logger('deliver: remote zot delivery succeeded to ' . $outq['outq_posturl']);
|
||||
zot_process_response($outq['outq_posturl'],$result, $outq);
|
||||
Libzot::process_response($outq['outq_posturl'],$result, $outq);
|
||||
}
|
||||
else {
|
||||
logger('deliver: remote zot delivery failed to ' . $outq['outq_posturl']);
|
||||
|
|
|
@ -3,6 +3,8 @@
|
|||
|
||||
// connect utility
|
||||
|
||||
use Zotlabs\Lib\Libzot;
|
||||
|
||||
if(! file_exists('include/cli_startup.php')) {
|
||||
echo t('Run from the top level $Projectname web directory, as util/connect <args>') . PHP_EOL;
|
||||
exit(1);
|
||||
|
@ -51,7 +53,7 @@ cli_startup();
|
|||
$abconfig = load_abconfig($c['channel_id'],$clone['abook_xchan']);
|
||||
if($abconfig)
|
||||
$clone['abconfig'] = $abconfig;
|
||||
build_sync_packet($c['channel_id'], array('abook' => array($clone)), true);
|
||||
Libzot::build_sync_packet($c['channel_id'], array('abook' => array($clone)), true);
|
||||
|
||||
$can_view_stream = their_perms_contains($c['channel_id'],$clone['abook_xchan'],'view_stream');
|
||||
|
||||
|
|
|
@ -1,6 +1,9 @@
|
|||
#!/usr/bin/env php
|
||||
<?php
|
||||
|
||||
|
||||
use Zotlabs\Lib\Libzot;
|
||||
|
||||
// file import to DAV utility
|
||||
|
||||
if(!file_exists('include/cli_startup.php')) {
|
||||
|
@ -52,6 +55,6 @@ if($argc != 2) {
|
|||
|
||||
$sync = attach_export_data($channel,$hash);
|
||||
if($sync) {
|
||||
build_sync_packet($channel['channel_id'],array('file' => array($sync)));
|
||||
Libzot::build_sync_packet($channel['channel_id'],array('file' => array($sync)));
|
||||
}
|
||||
}
|
|
@ -3,6 +3,8 @@
|
|||
|
||||
// Red pconfig utility
|
||||
|
||||
use Zotlabs\Lib\Libzot;
|
||||
|
||||
|
||||
if(!file_exists('include/cli_startup.php')) {
|
||||
echo 'Run pconfig from the top level Hubzilla web directory, as util/pconfig <args>' . PHP_EOL;
|
||||
|
@ -63,7 +65,7 @@ if($argc > 2 && strpos($argv[2],'.')) {
|
|||
|
||||
if($argc > 4) {
|
||||
set_pconfig($argv[1],$argv[2],$argv[3],$argv[4]);
|
||||
build_sync_packet($argv[1]);
|
||||
Libzot::build_sync_packet($argv[1]);
|
||||
echo "pconfig[{$argv[1]}][{$argv[2]}][{$argv[3]}] = " . get_pconfig($argv[1],$argv[2],$argv[3]) . "\n";
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue