diff options
53 files changed, 158 insertions, 87 deletions
diff --git a/Zotlabs/Daemon/Cron.php b/Zotlabs/Daemon/Cron.php index bd4e0b294..9cdfa9a0f 100644 --- a/Zotlabs/Daemon/Cron.php +++ b/Zotlabs/Daemon/Cron.php @@ -2,6 +2,8 @@ namespace Zotlabs\Daemon; +use Zotlabs\Lib\Libsync; + class Cron { static public function run($argc,$argv) { @@ -147,7 +149,7 @@ class Cron { if($z) { xchan_query($z); $sync_item = fetch_post_tags($z); - build_sync_packet($sync_item[0]['uid'], + Libsync::build_sync_packet($sync_item[0]['uid'], [ 'item' => [ encode_item($sync_item[0],true) ] ] diff --git a/Zotlabs/Daemon/Importfile.php b/Zotlabs/Daemon/Importfile.php index c68ed21cf..749949679 100644 --- a/Zotlabs/Daemon/Importfile.php +++ b/Zotlabs/Daemon/Importfile.php @@ -2,6 +2,8 @@ namespace Zotlabs\Daemon; +use Zotlabs\Lib\Libsync; + 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))); + Libsync::build_sync_packet($channel['channel_id'],array('file' => array($sync))); return; } diff --git a/Zotlabs/Lib/Apps.php b/Zotlabs/Lib/Apps.php index 9d60e9eae..d65eed14f 100644 --- a/Zotlabs/Lib/Apps.php +++ b/Zotlabs/Lib/Apps.php @@ -2,6 +2,8 @@ namespace Zotlabs\Lib; +use Zotlabs\Lib\Libsync; + require_once('include/plugin.php'); require_once('include/channel.php'); @@ -603,7 +605,7 @@ class Apps { intval(TERM_OBJ_APP), intval($r[0]['id']) ); - build_sync_packet($uid,array('app' => $r[0])); + Libsync::build_sync_packet($uid,array('app' => $r[0])); } } } @@ -669,7 +671,7 @@ class Apps { ); } if(! intval($x[0]['app_system'])) { - build_sync_packet($uid,array('app' => $x)); + Libsync::build_sync_packet($uid,array('app' => $x)); } } else { diff --git a/Zotlabs/Lib/Chatroom.php b/Zotlabs/Lib/Chatroom.php index 882c846cd..34853b6ab 100644 --- a/Zotlabs/Lib/Chatroom.php +++ b/Zotlabs/Lib/Chatroom.php @@ -1,6 +1,8 @@ <?php namespace Zotlabs\Lib; +use Zotlabs\Lib\Libsync; + /** * @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)); + Libsync::build_sync_packet($channel['channel_id'],array('chatroom' => $r)); q("delete from chatroom where cr_id = %d", intval($r[0]['cr_id']) diff --git a/Zotlabs/Lib/NativeWiki.php b/Zotlabs/Lib/NativeWiki.php index 662fddad0..6bda76eee 100644 --- a/Zotlabs/Lib/NativeWiki.php +++ b/Zotlabs/Lib/NativeWiki.php @@ -2,6 +2,8 @@ namespace Zotlabs\Lib; +use Zotlabs\Lib\Libsync; + define ( 'NWIKI_ITEM_RESOURCE_TYPE', 'nwiki' ); class NativeWiki { @@ -178,7 +180,7 @@ class NativeWiki { foreach($sync_item as $w) { $pkt[] = encode_item($w,true); } - build_sync_packet($uid,array('wiki' => $pkt)); + Libsync::build_sync_packet($uid,array('wiki' => $pkt)); } } } diff --git a/Zotlabs/Module/Channel_calendar.php b/Zotlabs/Module/Channel_calendar.php index 5d5fe300a..ae4afb2f3 100644 --- a/Zotlabs/Module/Channel_calendar.php +++ b/Zotlabs/Module/Channel_calendar.php @@ -1,6 +1,8 @@ <?php namespace Zotlabs\Module; +use Zotlabs\Lib\Libsync; + require_once('include/conversation.php'); require_once('include/bbcode.php'); require_once('include/datetime.php'); @@ -188,7 +190,7 @@ class Channel_calendar 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)); + Libsync::build_sync_packet($channel['channel_id'],array('event_item' => array(encode_item($sync_item[0],true)),'event' => $z)); } } } @@ -430,7 +432,7 @@ class Channel_calendar extends \Zotlabs\Web\Controller { if($r) { $sync_event['event_deleted'] = 1; - build_sync_packet(0,array('event' => array($sync_event))); + Libsync::build_sync_packet(0,array('event' => array($sync_event))); $i = q("select * from item where resource_type = 'event' and resource_id = '%s' and uid = %d", dbesc($event_id), @@ -479,7 +481,7 @@ class Channel_calendar extends \Zotlabs\Web\Controller { if($ii) { xchan_query($ii); $sync_item = fetch_post_tags($ii); - build_sync_packet($i[0]['uid'],array('item' => array(encode_item($sync_item[0],true)))); + Libsync::build_sync_packet($i[0]['uid'],array('item' => array(encode_item($sync_item[0],true)))); } if($complex) { diff --git a/Zotlabs/Module/Chat.php b/Zotlabs/Module/Chat.php index db77e2612..6a46cdace 100644 --- a/Zotlabs/Module/Chat.php +++ b/Zotlabs/Module/Chat.php @@ -7,9 +7,7 @@ use Zotlabs\Lib\Apps; use Zotlabs\Web\Controller; use Zotlabs\Lib\Chatroom; use Zotlabs\Access\AccessList; - - - +use Zotlabs\Lib\Libsync; require_once('include/bookmarks.php'); @@ -80,7 +78,7 @@ class Chat extends Controller { intval(local_channel()) ); - build_sync_packet(0, array('chatroom' => $x)); + Libsync::build_sync_packet(0, array('chatroom' => $x)); if($x) goaway(z_root() . '/chat/' . $channel['channel_address'] . '/' . $x[0]['cr_id']); diff --git a/Zotlabs/Module/Connedit.php b/Zotlabs/Module/Connedit.php index acd7cb769..c0df57390 100644 --- a/Zotlabs/Module/Connedit.php +++ b/Zotlabs/Module/Connedit.php @@ -9,6 +9,7 @@ namespace Zotlabs\Module; use Zotlabs\Lib\Apps; use Zotlabs\Lib\Libzot; +use Zotlabs\Lib\Libsync; require_once('include/socgraph.php'); require_once('include/selectors.php'); @@ -382,7 +383,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))); + Libsync::build_sync_packet(0 /* use the current local_channel */, array('abook' => array($clone))); } /* @brief Generate content of connection edit page @@ -558,7 +559,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 */, + Libsync::build_sync_packet(0 /* use the current local_channel */, array('abook' => array(array( 'abook_xchan' => $orig_record[0]['abook_xchan'], 'entry_deleted' => true)) diff --git a/Zotlabs/Module/Cover_photo.php b/Zotlabs/Module/Cover_photo.php index d97014f9c..615ca6fe0 100644 --- a/Zotlabs/Module/Cover_photo.php +++ b/Zotlabs/Module/Cover_photo.php @@ -1,6 +1,8 @@ <?php namespace Zotlabs\Module; +use Zotlabs\Lib\Libsync; + /* @file cover_photo.php @brief Module-file with functions for handling of cover-photos @@ -66,7 +68,7 @@ class Cover_photo extends \Zotlabs\Web\Controller { $sync = attach_export_data($channel,$r[0]['resource_id']); if($sync) - build_sync_packet($channel['channel_id'],array('file' => array($sync))); + Libsync::build_sync_packet($channel['channel_id'],array('file' => array($sync))); } // Update directory in background @@ -230,7 +232,7 @@ class Cover_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))); + Libsync::build_sync_packet($channel['channel_id'],array('file' => array($sync))); // Update directory in background \Zotlabs\Daemon\Master::Summon(array('Directory',$channel['channel_id'])); diff --git a/Zotlabs/Module/Defperms.php b/Zotlabs/Module/Defperms.php index 463ecb57a..f2f7c10e5 100644 --- a/Zotlabs/Module/Defperms.php +++ b/Zotlabs/Module/Defperms.php @@ -4,6 +4,7 @@ namespace Zotlabs\Module; use App; use Zotlabs\Lib\Apps; use Zotlabs\Web\Controller; +use Zotlabs\Lib\Libsync; require_once('include/socgraph.php'); require_once('include/selectors.php'); @@ -164,7 +165,7 @@ class Defperms extends Controller { if($abconfig) $clone['abconfig'] = $abconfig; - build_sync_packet(0 /* use the current local_channel */, array('abook' => array($clone))); + Libsync::build_sync_packet(0 /* use the current local_channel */, array('abook' => array($clone))); } /* @brief Generate content of connection default permissions page diff --git a/Zotlabs/Module/File_upload.php b/Zotlabs/Module/File_upload.php index 4d1cc4cda..1735e9487 100644 --- a/Zotlabs/Module/File_upload.php +++ b/Zotlabs/Module/File_upload.php @@ -1,6 +1,8 @@ <?php namespace Zotlabs\Module; +use Zotlabs\Lib\Libsync; + 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))); + Libsync::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))); + Libsync::build_sync_packet($channel['channel_id'],array('file' => array($sync))); } } diff --git a/Zotlabs/Module/Filestorage.php b/Zotlabs/Module/Filestorage.php index 2c247cd65..c40de2823 100644 --- a/Zotlabs/Module/Filestorage.php +++ b/Zotlabs/Module/Filestorage.php @@ -5,7 +5,7 @@ namespace Zotlabs\Module; * */ - +use Zotlabs\Lib\Libsync; class Filestorage extends \Zotlabs\Web\Controller { @@ -131,7 +131,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))); + Libsync::build_sync_packet($channel['channel_id'], array('file' => array($sync))); } } diff --git a/Zotlabs/Module/Group.php b/Zotlabs/Module/Group.php index f836978ee..993d428f5 100644 --- a/Zotlabs/Module/Group.php +++ b/Zotlabs/Module/Group.php @@ -4,6 +4,7 @@ namespace Zotlabs\Module; use App; use Zotlabs\Web\Controller; use Zotlabs\Lib\Apps; +use Zotlabs\Lib\Libsync; require_once('include/group.php'); @@ -80,7 +81,7 @@ class Group extends Controller { info( t('Privacy group updated.') . EOL ); - build_sync_packet(local_channel(),null,true); + Libsync::build_sync_packet(local_channel(),null,true); } goaway(z_root() . '/group/' . argv(1) . '/' . argv(2)); diff --git a/Zotlabs/Module/Like.php b/Zotlabs/Module/Like.php index e4636a4a6..61f73bfd5 100644 --- a/Zotlabs/Module/Like.php +++ b/Zotlabs/Module/Like.php @@ -2,6 +2,7 @@ namespace Zotlabs\Module; use Zotlabs\Lib\Activity; +use Zotlabs\Lib\Libsync; require_once('include/security.php'); require_once('include/bbcode.php'); @@ -235,7 +236,7 @@ class Like extends \Zotlabs\Web\Controller { if($z) { $z[0]['deleted'] = 1; - build_sync_packet($ch[0]['channel_id'],array('likes' => $z)); + Libsync::build_sync_packet($ch[0]['channel_id'],array('likes' => $z)); q("delete from likes where id = %d", intval($z[0]['id']) @@ -566,7 +567,7 @@ class Like extends \Zotlabs\Web\Controller { dbesc($obj_id) ); if($r) - build_sync_packet($ch[0]['channel_id'],array('likes' => $r)); + Libsync::build_sync_packet($ch[0]['channel_id'],array('likes' => $r)); } diff --git a/Zotlabs/Module/Moderate.php b/Zotlabs/Module/Moderate.php index a7c98e05e..f1bff3c50 100644 --- a/Zotlabs/Module/Moderate.php +++ b/Zotlabs/Module/Moderate.php @@ -2,6 +2,8 @@ namespace Zotlabs\Module; +use Zotlabs\Lib\Libsync; + 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)))); + Libsync::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)); diff --git a/Zotlabs/Module/Notes.php b/Zotlabs/Module/Notes.php index 7572f7420..b448cff83 100644 --- a/Zotlabs/Module/Notes.php +++ b/Zotlabs/Module/Notes.php @@ -4,6 +4,7 @@ namespace Zotlabs\Module; use App; use Zotlabs\Web\Controller; use Zotlabs\Lib\Apps; +use Zotlabs\Lib\Libsync; /** * @brief Notes Module controller. @@ -38,7 +39,7 @@ class Notes extends Controller { if((argc() > 1) && (argv(1) === 'sync')) { require_once('include/zot.php'); - build_sync_packet(); + Libsync::build_sync_packet(); } logger('notes saved.', LOGGER_DEBUG); diff --git a/Zotlabs/Module/Pconfig.php b/Zotlabs/Module/Pconfig.php index 06b94b34f..b2b5d4386 100644 --- a/Zotlabs/Module/Pconfig.php +++ b/Zotlabs/Module/Pconfig.php @@ -1,7 +1,7 @@ <?php namespace Zotlabs\Module; - +use Zotlabs\Lib\Libsync; @@ -38,7 +38,7 @@ class Pconfig extends \Zotlabs\Web\Controller { } set_pconfig(local_channel(),$cat,$k,$v); - build_sync_packet(); + Libsync::build_sync_packet(); if($aj) killme(); diff --git a/Zotlabs/Module/Pdledit.php b/Zotlabs/Module/Pdledit.php index 5cedb29a8..36201544f 100644 --- a/Zotlabs/Module/Pdledit.php +++ b/Zotlabs/Module/Pdledit.php @@ -4,6 +4,7 @@ namespace Zotlabs\Module; use App; use Zotlabs\Web\Controller; use Zotlabs\Lib\Apps; +use Zotlabs\Lib\Libsync; class Pdledit extends Controller { @@ -22,7 +23,7 @@ class Pdledit extends Controller { goaway(z_root() . '/pdledit'); } set_pconfig(local_channel(),'system','mod_' . $_REQUEST['module'] . '.pdl',escape_tags($_REQUEST['content'])); - build_sync_packet(); + Libsync::build_sync_packet(); info( t('Layout updated.') . EOL); goaway(z_root() . '/pdledit/' . $_REQUEST['module']); } diff --git a/Zotlabs/Module/Permcats.php b/Zotlabs/Module/Permcats.php index 75ac2ac87..6a599282c 100644 --- a/Zotlabs/Module/Permcats.php +++ b/Zotlabs/Module/Permcats.php @@ -5,6 +5,7 @@ namespace Zotlabs\Module; use App; use Zotlabs\Web\Controller; use Zotlabs\Lib\Apps; +use Zotlabs\Lib\Libsync; class Permcats extends Controller { @@ -42,7 +43,7 @@ class Permcats extends Controller { \Zotlabs\Lib\Permcat::update(local_channel(),$name,$pcarr); - build_sync_packet(); + Libsync::build_sync_packet(); info( t('Permission category saved.') . EOL); @@ -71,7 +72,7 @@ class Permcats extends Controller { if(argc() > 2 && argv(2) === 'drop') { \Zotlabs\Lib\Permcat::delete(local_channel(),$name); - build_sync_packet(); + Libsync::build_sync_packet(); json_return_and_die([ 'success' => true ]); } diff --git a/Zotlabs/Module/Photos.php b/Zotlabs/Module/Photos.php index 43c9f86ee..fae8c17f6 100644 --- a/Zotlabs/Module/Photos.php +++ b/Zotlabs/Module/Photos.php @@ -1,6 +1,8 @@ <?php namespace Zotlabs\Module; +use Zotlabs\Lib\Libsync; + require_once('include/photo/photo_driver.php'); require_once('include/photos.php'); require_once('include/items.php'); @@ -162,7 +164,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))); + Libsync::build_sync_packet($page_owner_uid,array('file' => array($sync))); } } @@ -189,7 +191,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))); + Libsync::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 +212,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))); + Libsync::build_sync_packet($page_owner_uid,array('file' => array($sync))); if(! ($_POST['desc'] && $_POST['newtag'])) goaway(z_root() . '/' . $_SESSION['photo_return']); @@ -420,7 +422,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))); + Libsync::build_sync_packet($page_owner_uid,array('file' => array($sync))); goaway(z_root() . '/' . $_SESSION['photo_return']); return; // NOTREACHED diff --git a/Zotlabs/Module/Profile_photo.php b/Zotlabs/Module/Profile_photo.php index a812ca210..d6c80b653 100644 --- a/Zotlabs/Module/Profile_photo.php +++ b/Zotlabs/Module/Profile_photo.php @@ -1,6 +1,8 @@ <?php namespace Zotlabs\Module; +use Zotlabs\Lib\Libsync; + /* * @file Profile_photo.php * @brief Module-file with functions for handling of profile-photos @@ -73,7 +75,7 @@ class Profile_photo extends \Zotlabs\Web\Controller { $sync = attach_export_data($channel,$r[0]['resource_id']); if($sync) - build_sync_packet($channel['channel_id'],array('file' => array($sync))); + Libsync:: build_sync_packet($channel['channel_id'],array('file' => array($sync))); } $_SESSION['reload_avatar'] = true; @@ -243,7 +245,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)); + Libsync::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. @@ -411,7 +413,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))); + Libsync::build_sync_packet($channel['channel_id'],array('file' => array($sync))); $_SESSION['reload_avatar'] = true; diff --git a/Zotlabs/Module/Profiles.php b/Zotlabs/Module/Profiles.php index 33e7d8a9d..7deceabab 100644 --- a/Zotlabs/Module/Profiles.php +++ b/Zotlabs/Module/Profiles.php @@ -1,6 +1,8 @@ <?php namespace Zotlabs\Module; +use Zotlabs\Lib\Libsync; + 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)); + Libsync::build_sync_packet(local_channel(),array('profile' => $r)); } $channel = \App::get_channel(); diff --git a/Zotlabs/Module/Settings/Calendar.php b/Zotlabs/Module/Settings/Calendar.php index 0298b412e..ab85eb450 100644 --- a/Zotlabs/Module/Settings/Calendar.php +++ b/Zotlabs/Module/Settings/Calendar.php @@ -2,6 +2,7 @@ namespace Zotlabs\Module\Settings; +use Zotlabs\Lib\Libsync; class Calendar { @@ -15,7 +16,7 @@ class Calendar { process_module_features_post(local_channel(), $features, $_POST); - build_sync_packet(); + Libsync::build_sync_packet(); if($_POST['rpath']) goaway($_POST['rpath']); diff --git a/Zotlabs/Module/Settings/Channel.php b/Zotlabs/Module/Settings/Channel.php index b0115d352..ab9b72490 100644 --- a/Zotlabs/Module/Settings/Channel.php +++ b/Zotlabs/Module/Settings/Channel.php @@ -3,6 +3,7 @@ namespace Zotlabs\Module\Settings; use Zotlabs\Lib\Apps; +use Zotlabs\Lib\Libsync; require_once('include/selectors.php'); @@ -286,7 +287,7 @@ class Channel { \Zotlabs\Daemon\Master::Summon(array('Directory',local_channel())); - build_sync_packet(); + Libsync::build_sync_packet(); if($email_changed && \App::$config['system']['register_policy'] == REGISTER_VERIFY) { diff --git a/Zotlabs/Module/Settings/Channel_home.php b/Zotlabs/Module/Settings/Channel_home.php index b6ecf4ff1..e8faa7fb2 100644 --- a/Zotlabs/Module/Settings/Channel_home.php +++ b/Zotlabs/Module/Settings/Channel_home.php @@ -2,6 +2,8 @@ namespace Zotlabs\Module\Settings; +use Zotlabs\Lib\Libsync; + require_once('include/menu.php'); class Channel_home { @@ -24,7 +26,7 @@ class Channel_home { $channel_menu = ((x($_POST['channel_menu'])) ? htmlspecialchars_decode(trim($_POST['channel_menu']),ENT_QUOTES) : ''); set_pconfig(local_channel(),'system','channel_menu',$channel_menu); - build_sync_packet(); + Libsync::build_sync_packet(); if($_POST['rpath']) goaway($_POST['rpath']); diff --git a/Zotlabs/Module/Settings/Connections.php b/Zotlabs/Module/Settings/Connections.php index cac357791..4369deb27 100644 --- a/Zotlabs/Module/Settings/Connections.php +++ b/Zotlabs/Module/Settings/Connections.php @@ -2,6 +2,7 @@ namespace Zotlabs\Module\Settings; +use Zotlabs\Lib\Libsync; class Connections { @@ -15,7 +16,7 @@ class Connections { process_module_features_post(local_channel(), $features, $_POST); - build_sync_packet(); + Libsync::build_sync_packet(); if($_POST['rpath']) goaway($_POST['rpath']); diff --git a/Zotlabs/Module/Settings/Conversation.php b/Zotlabs/Module/Settings/Conversation.php index 43e59a3c2..aa0ff6a7e 100644 --- a/Zotlabs/Module/Settings/Conversation.php +++ b/Zotlabs/Module/Settings/Conversation.php @@ -2,6 +2,7 @@ namespace Zotlabs\Module\Settings; +use Zotlabs\Lib\Libsync; class Conversation { @@ -15,7 +16,7 @@ class Conversation { process_module_features_post(local_channel(), $features, $_POST); - build_sync_packet(); + Libsync::build_sync_packet(); if($_POST['aj']) { if($_POST['auto_update'] == 1) diff --git a/Zotlabs/Module/Settings/Directory.php b/Zotlabs/Module/Settings/Directory.php index 13fe6eb79..d1dd0677e 100644 --- a/Zotlabs/Module/Settings/Directory.php +++ b/Zotlabs/Module/Settings/Directory.php @@ -2,6 +2,7 @@ namespace Zotlabs\Module\Settings; +use Zotlabs\Lib\Libsync; class Directory { @@ -15,7 +16,7 @@ class Directory { process_module_features_post(local_channel(), $features, $_POST); - build_sync_packet(); + Libsync::build_sync_packet(); if($_POST['rpath']) goaway($_POST['rpath']); diff --git a/Zotlabs/Module/Settings/Display.php b/Zotlabs/Module/Settings/Display.php index 45d80e011..f553fc057 100644 --- a/Zotlabs/Module/Settings/Display.php +++ b/Zotlabs/Module/Settings/Display.php @@ -2,6 +2,7 @@ namespace Zotlabs\Module\Settings; +use Zotlabs\Lib\Libsync; class Display { @@ -78,7 +79,7 @@ class Display { ); call_hooks('display_settings_post', $_POST); - build_sync_packet(); + Libsync::build_sync_packet(); goaway(z_root() . '/settings/display' ); return; // NOTREACHED } diff --git a/Zotlabs/Module/Settings/Editor.php b/Zotlabs/Module/Settings/Editor.php index 5e7a9473a..cf6dd2807 100644 --- a/Zotlabs/Module/Settings/Editor.php +++ b/Zotlabs/Module/Settings/Editor.php @@ -2,6 +2,7 @@ namespace Zotlabs\Module\Settings; +use Zotlabs\Lib\Libsync; class Editor { @@ -15,7 +16,7 @@ class Editor { process_module_features_post(local_channel(), $features, $_POST); - build_sync_packet(); + Libsync::build_sync_packet(); if($_POST['rpath']) goaway($_POST['rpath']); diff --git a/Zotlabs/Module/Settings/Events.php b/Zotlabs/Module/Settings/Events.php index eb6dda99b..ab393c932 100644 --- a/Zotlabs/Module/Settings/Events.php +++ b/Zotlabs/Module/Settings/Events.php @@ -2,6 +2,7 @@ namespace Zotlabs\Module\Settings; +use Zotlabs\Lib\Libsync; class Events { @@ -15,7 +16,7 @@ class Events { process_module_features_post(local_channel(), $features, $_POST); - build_sync_packet(); + Libsync::build_sync_packet(); if($_POST['rpath']) goaway($_POST['rpath']); diff --git a/Zotlabs/Module/Settings/Featured.php b/Zotlabs/Module/Settings/Featured.php index d5d740aff..d615e176c 100644 --- a/Zotlabs/Module/Settings/Featured.php +++ b/Zotlabs/Module/Settings/Featured.php @@ -2,6 +2,7 @@ namespace Zotlabs\Module\Settings; +use Zotlabs\Lib\Libsync; class Featured { @@ -10,7 +11,7 @@ class Featured { call_hooks('feature_settings_post', $_POST); - build_sync_packet(); + Libsync::build_sync_packet(); return; } diff --git a/Zotlabs/Module/Settings/Features.php b/Zotlabs/Module/Settings/Features.php index 6a3ab104b..553ff0836 100644 --- a/Zotlabs/Module/Settings/Features.php +++ b/Zotlabs/Module/Settings/Features.php @@ -2,6 +2,8 @@ namespace Zotlabs\Module\Settings; +use Zotlabs\Lib\Libsync; + class Features { @@ -19,7 +21,7 @@ class Features { set_pconfig(local_channel(),'feature', $k, ''); } } - build_sync_packet(); + Libsync::build_sync_packet(); return; } diff --git a/Zotlabs/Module/Settings/Manage.php b/Zotlabs/Module/Settings/Manage.php index 9bae12022..cbc494cf8 100644 --- a/Zotlabs/Module/Settings/Manage.php +++ b/Zotlabs/Module/Settings/Manage.php @@ -2,6 +2,8 @@ namespace Zotlabs\Module\Settings; +use Zotlabs\Lib\Libsync; + class Manage { @@ -15,7 +17,7 @@ class Manage { process_module_features_post(local_channel(), $features, $_POST); - build_sync_packet(); + Libsync::build_sync_packet(); if($_POST['rpath']) goaway($_POST['rpath']); diff --git a/Zotlabs/Module/Settings/Network.php b/Zotlabs/Module/Settings/Network.php index ae02b06e9..9f5bdb2e5 100644 --- a/Zotlabs/Module/Settings/Network.php +++ b/Zotlabs/Module/Settings/Network.php @@ -2,6 +2,7 @@ namespace Zotlabs\Module\Settings; +use Zotlabs\Lib\Libsync; class Network { @@ -21,7 +22,7 @@ class Network { set_pconfig(local_channel(),'system','network_divmore_height', $network_divmore_height); - build_sync_packet(); + Libsync::build_sync_packet(); if($_POST['rpath']) goaway($_POST['rpath']); diff --git a/Zotlabs/Module/Settings/Photos.php b/Zotlabs/Module/Settings/Photos.php index 9edbaa929..8195d660b 100644 --- a/Zotlabs/Module/Settings/Photos.php +++ b/Zotlabs/Module/Settings/Photos.php @@ -2,6 +2,7 @@ namespace Zotlabs\Module\Settings; +use Zotlabs\Lib\Libsync; class Photos { @@ -15,7 +16,7 @@ class Photos { process_module_features_post(local_channel(), $features, $_POST); - build_sync_packet(); + Libsync::build_sync_packet(); if($_POST['rpath']) goaway($_POST['rpath']); diff --git a/Zotlabs/Module/Settings/Profiles.php b/Zotlabs/Module/Settings/Profiles.php index fb6abf664..67b03e04f 100644 --- a/Zotlabs/Module/Settings/Profiles.php +++ b/Zotlabs/Module/Settings/Profiles.php @@ -2,6 +2,8 @@ namespace Zotlabs\Module\Settings; +use Zotlabs\Lib\Libsync; + require_once('include/selectors.php'); class Profiles { @@ -19,7 +21,7 @@ class Profiles { $profile_assign = ((x($_POST,'profile_assign')) ? notags(trim($_POST['profile_assign'])) : ''); set_pconfig(local_channel(),'system','profile_assign',$profile_assign); - build_sync_packet(); + Libsync::build_sync_packet(); if($_POST['rpath']) goaway($_POST['rpath']); diff --git a/Zotlabs/Module/Share.php b/Zotlabs/Module/Share.php index a18a81937..c0db9978e 100644 --- a/Zotlabs/Module/Share.php +++ b/Zotlabs/Module/Share.php @@ -4,6 +4,7 @@ namespace Zotlabs\Module; use App; use Zotlabs\Daemon\Master; use Zotlabs\Lib\Activity; +use Zotlabs\Lib\Libsync; require_once('include/security.php'); @@ -124,7 +125,7 @@ class Share extends \Zotlabs\Web\Controller { if($r) { xchan_query($r); $sync_item = fetch_post_tags($r); - build_sync_packet($channel['channel_id'], [ 'item' => [ encode_item($sync_item[0],true) ] ]); + Libsync::build_sync_packet($channel['channel_id'], [ 'item' => [ encode_item($sync_item[0],true) ] ]); } Master::Summon([ 'Notifier','like',$post_id ]); diff --git a/Zotlabs/Module/Starred.php b/Zotlabs/Module/Starred.php index 8349ae25c..2d7063669 100644 --- a/Zotlabs/Module/Starred.php +++ b/Zotlabs/Module/Starred.php @@ -1,6 +1,7 @@ <?php namespace Zotlabs\Module; +use Zotlabs\Lib\Libsync; 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(),[ + Libsync::build_sync_packet(local_channel(),[ 'item' => [ encode_item($sync_item[0],true) ] diff --git a/Zotlabs/Module/Tagger.php b/Zotlabs/Module/Tagger.php index e6e80dce3..4fbfb7070 100644 --- a/Zotlabs/Module/Tagger.php +++ b/Zotlabs/Module/Tagger.php @@ -1,6 +1,8 @@ <?php namespace Zotlabs\Module; +use Zotlabs\Lib\Libsync; + 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(), + Libsync::build_sync_packet(local_channel(), [ 'item' => [ encode_item($ret['activity'],true) ] ] diff --git a/Zotlabs/Module/Thing.php b/Zotlabs/Module/Thing.php index c3d8ff802..b065b0022 100644 --- a/Zotlabs/Module/Thing.php +++ b/Zotlabs/Module/Thing.php @@ -5,6 +5,8 @@ namespace Zotlabs\Module; +use Zotlabs\Lib\Libsync; + require_once('include/items.php'); require_once('include/security.php'); require_once('include/selectors.php'); @@ -124,7 +126,7 @@ class Thing extends \Zotlabs\Web\Controller { dbesc($term_hash) ); if($r) { - build_sync_packet(0, array('obj' => $r)); + Libsync::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)); + Libsync::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)); + Libsync::build_sync_packet(0,array('obj' => $r)); return $o; } diff --git a/Zotlabs/Module/Wall_attach.php b/Zotlabs/Module/Wall_attach.php index e1088d18f..2c0eeec77 100644 --- a/Zotlabs/Module/Wall_attach.php +++ b/Zotlabs/Module/Wall_attach.php @@ -1,6 +1,8 @@ <?php namespace Zotlabs\Module; +use Zotlabs\Lib\Libsync; + require_once('include/attach.php'); require_once('include/photos.php'); @@ -134,7 +136,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))); + Libsync::build_sync_packet($channel['channel_id'],array('file' => array($sync))); } if($using_api) diff --git a/Zotlabs/Storage/Directory.php b/Zotlabs/Storage/Directory.php index ae36fc1c0..8cda75fd1 100644 --- a/Zotlabs/Storage/Directory.php +++ b/Zotlabs/Storage/Directory.php @@ -3,6 +3,7 @@ namespace Zotlabs\Storage; use Sabre\DAV; +use Zotlabs\Lib\Libsync; /** * @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))); + Libsync::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))); + Libsync::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))); + Libsync::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))); + Libsync::build_sync_packet($ch['channel_id'], array('file' => array($sync))); } } diff --git a/Zotlabs/Storage/File.php b/Zotlabs/Storage/File.php index 36aff1e05..68edde166 100644 --- a/Zotlabs/Storage/File.php +++ b/Zotlabs/Storage/File.php @@ -3,6 +3,7 @@ namespace Zotlabs\Storage; use Sabre\DAV; +use Zotlabs\Lib\Libsync; /** * @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))); + Libsync::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))); + Libsync::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))); + Libsync::build_sync_packet($ch['channel_id'], array('file' => array($sync))); } } } diff --git a/include/attach.php b/include/attach.php index 952270949..d986f4af1 100644 --- a/include/attach.php +++ b/include/attach.php @@ -11,6 +11,8 @@ * @todo Also an 'append' option to the storage function might be a useful addition. */ +use Zotlabs\Lib\Libsync; + require_once('include/permissions.php'); require_once('include/security.php'); require_once('include/group.php'); @@ -1018,7 +1020,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))); + Libsync::build_sync_packet($channel['channel_id'],array('file' => array($sync))); } if($notify) { @@ -1403,7 +1405,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))); + Libsync::build_sync_packet($channel['channel_id'],array('file' => array($data))); } } diff --git a/include/channel.php b/include/channel.php index 25eb93cac..be58f154a 100644 --- a/include/channel.php +++ b/include/channel.php @@ -673,7 +673,7 @@ function change_channel_keys($channel) { } } - build_sync_packet($channel['channel_id'], [ 'keychange' => $stored ]); + Libsync::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']) @@ -2241,7 +2241,7 @@ function profiles_build_sync($channel_id,$send = true) { ); if($r) { if($send) { - build_sync_packet($channel_id,array('profile' => $r)); + Libsync::build_sync_packet($channel_id,array('profile' => $r)); } else { return $r; diff --git a/include/event.php b/include/event.php index 69ca64e0f..c9cbb7c94 100644 --- a/include/event.php +++ b/include/event.php @@ -8,6 +8,7 @@ use Sabre\VObject; use Zotlabs\Lib\Activity; +use Zotlabs\Lib\Libsync; use Ramsey\Uuid\Uuid; use Ramsey\Uuid\Exception\UnsatisfiedDependencyException; @@ -663,7 +664,7 @@ function event_addtocal($item_id, $uid) { intval($channel['channel_id']) ); if($z) { - build_sync_packet($channel['channel_id'],array('event_item' => array(encode_item($sync_item[0],true)),'event' => $z)); + Libsync::build_sync_packet($channel['channel_id'],array('event_item' => array(encode_item($sync_item[0],true)),'event' => $z)); } return true; } diff --git a/include/group.php b/include/group.php index 6011af08f..efda389d6 100644 --- a/include/group.php +++ b/include/group.php @@ -1,5 +1,6 @@ <?php /** @file */ +use Zotlabs\Lib\Libsync; function group_add($uid,$name,$public = 0) { @@ -44,7 +45,7 @@ function group_add($uid,$name,$public = 0) { $ret = $r; } - build_sync_packet($uid,null,true); + Libsync::build_sync_packet($uid,null,true); return $ret; } @@ -113,7 +114,7 @@ function group_rmv($uid,$name) { } - build_sync_packet($uid,null,true); + Libsync::build_sync_packet($uid,null,true); return $ret; } @@ -155,7 +156,7 @@ function group_rmv_member($uid,$name,$member) { dbesc($member) ); - build_sync_packet($uid,null,true); + Libsync::build_sync_packet($uid,null,true); return $r; @@ -186,7 +187,7 @@ function group_add_member($uid,$name,$member,$gid = 0) { dbesc($member) ); - build_sync_packet($uid,null,true); + Libsync::build_sync_packet($uid,null,true); return $r; } diff --git a/include/items.php b/include/items.php index 9768fdf23..6fe5e1f0b 100755 --- a/include/items.php +++ b/include/items.php @@ -10,6 +10,7 @@ use Zotlabs\Lib\MessageFilter; use Zotlabs\Lib\ThreadListener; use Zotlabs\Lib\IConfig; use Zotlabs\Lib\Activity; +use Zotlabs\Lib\Libsync; use Zotlabs\Access\PermissionLimits; use Zotlabs\Access\AccessList; use Zotlabs\Daemon\Master; @@ -3873,7 +3874,7 @@ function delete_item_lowlevel($item, $stage = DROPITEM_NORMAL) { if($x) { $sync_data['event_deleted'] = 1; - build_sync_packet($item['uid'], ['event' => [$sync_data]]); + Libsync::build_sync_packet($item['uid'], ['event' => [$sync_data]]); } } @@ -3882,7 +3883,7 @@ function delete_item_lowlevel($item, $stage = DROPITEM_NORMAL) { $channel = channelx_by_n($item['uid']); $sync_data = attach_export_data($channel, $item['resource_id'], true); if($sync_data) - build_sync_packet($item['uid'], ['file' => [$sync_data]]); + Libsync::build_sync_packet($item['uid'], ['file' => [$sync_data]]); } // immediately remove any undesired profile likes. @@ -4726,7 +4727,7 @@ function sync_an_item($channel_id,$item_id) { if($r) { xchan_query($r); $sync_item = fetch_post_tags($r); - build_sync_packet($channel_id, array('item' => array(encode_item($sync_item[0],true)))); + Libsync::build_sync_packet($channel_id, array('item' => array(encode_item($sync_item[0],true)))); } } @@ -4928,7 +4929,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)))); + Libsync::build_sync_packet($new_item['uid'],array('item' => array(encode_item($sync_item[0],true)))); } } diff --git a/include/menu.php b/include/menu.php index 1a2059451..88863f57b 100644 --- a/include/menu.php +++ b/include/menu.php @@ -1,5 +1,7 @@ <?php /** @file */ +use Zotlabs\Lib\Libsync; + require_once('include/security.php'); require_once('include/bbcode.php'); @@ -405,7 +407,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)))); + Libsync::build_sync_packet($uid,array('menu' => array(menu_element($c,$m)))); } } } diff --git a/util/connect b/util/connect index eed14961c..7ceda300f 100755 --- a/util/connect +++ b/util/connect @@ -1,6 +1,8 @@ #!/usr/bin/env php <?php +use Zotlabs\Lib\Libsync; + // connect utility if(! file_exists('include/cli_startup.php')) { @@ -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); + Libsync::build_sync_packet($c['channel_id'], array('abook' => array($clone)), true); $can_view_stream = intval(get_abconfig($c['channel_id'],$clone['abook_xchan'],'their_perms','view_stream')); diff --git a/util/dmkdir b/util/dmkdir index 72ab22431..b939bc901 100755 --- a/util/dmkdir +++ b/util/dmkdir @@ -1,6 +1,8 @@ #!/usr/bin/env php <?php +use Zotlabs\Lib\Libsync; + // file import to DAV utility if(!file_exists('include/cli_startup.php')) { @@ -52,6 +54,6 @@ if($argc != 2) { $sync = attach_export_data($channel,$hash); if($sync) { - build_sync_packet($channel['channel_id'],array('file' => array($sync))); + Libsync::build_sync_packet($channel['channel_id'],array('file' => array($sync))); } - }
\ No newline at end of file + } diff --git a/util/pconfig b/util/pconfig index 36d894fb5..c2027adaf 100755 --- a/util/pconfig +++ b/util/pconfig @@ -1,6 +1,8 @@ #!/usr/bin/env php <?php +use Zotlabs\Lib\Libsync; + // Red pconfig utility @@ -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]); + Libsync::build_sync_packet($argv[1]); echo "pconfig[{$argv[1]}][{$argv[2]}][{$argv[3]}] = " . get_pconfig($argv[1],$argv[2],$argv[3]) . "\n"; } |