From d79e81a0697617b5552917c2fe169b30433c54f6 Mon Sep 17 00:00:00 2001 From: redmatrix Date: Thu, 3 Sep 2015 18:44:40 -0700 Subject: import and sync chatrooms --- include/zot.php | 3 +++ 1 file changed, 3 insertions(+) (limited to 'include/zot.php') diff --git a/include/zot.php b/include/zot.php index fecaa7ad2..9610df894 100644 --- a/include/zot.php +++ b/include/zot.php @@ -2881,6 +2881,9 @@ function process_channel_sync_delivery($sender, $arr, $deliveries) { if(array_key_exists('app',$arr) && $arr['app']) sync_apps($channel,$arr['app']); + if(array_key_exists('chatroom',$arr) && $arr['chatroom']) + sync_apps($channel,$arr['chatroom']); + if(array_key_exists('channel',$arr) && is_array($arr['channel']) && count($arr['channel'])) { if(array_key_exists('channel_page_flags',$arr['channel']) && intval($arr['channel']['channel_pageflags'])) { $arr['channel']['channel_removed'] = (($arr['channel']['channel_pageflags'] & 0x8000) ? 1 : 0); -- cgit v1.2.3 From 6d1b64065aa1f44e2b9d864ddba97891ca85d1e5 Mon Sep 17 00:00:00 2001 From: redmatrix Date: Mon, 7 Sep 2015 18:14:30 -0700 Subject: consolidate import_items/sync_items --- include/zot.php | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'include/zot.php') diff --git a/include/zot.php b/include/zot.php index 9610df894..6f159b4f8 100644 --- a/include/zot.php +++ b/include/zot.php @@ -2884,6 +2884,12 @@ function process_channel_sync_delivery($sender, $arr, $deliveries) { if(array_key_exists('chatroom',$arr) && $arr['chatroom']) sync_apps($channel,$arr['chatroom']); + if(array_key_exists('item',$arr) && $arr['item']) + sync_items($channel,$arr['item']); + + if(array_key_exists('item_id',$arr) && $arr['item_id']) + sync_items($channel,$arr['item_id']); + if(array_key_exists('channel',$arr) && is_array($arr['channel']) && count($arr['channel'])) { if(array_key_exists('channel_page_flags',$arr['channel']) && intval($arr['channel']['channel_pageflags'])) { $arr['channel']['channel_removed'] = (($arr['channel']['channel_pageflags'] & 0x8000) ? 1 : 0); -- cgit v1.2.3 From 650e98b2a9aff2f54be84782ac48cc57badbf76f Mon Sep 17 00:00:00 2001 From: redmatrix Date: Mon, 7 Sep 2015 21:01:49 -0700 Subject: work on event sync --- include/zot.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'include/zot.php') diff --git a/include/zot.php b/include/zot.php index 6f159b4f8..285668209 100644 --- a/include/zot.php +++ b/include/zot.php @@ -2882,7 +2882,13 @@ function process_channel_sync_delivery($sender, $arr, $deliveries) { sync_apps($channel,$arr['app']); if(array_key_exists('chatroom',$arr) && $arr['chatroom']) - sync_apps($channel,$arr['chatroom']); + sync_chatrooms($channel,$arr['chatroom']); + + if(array_key_exists('event',$arr) && $arr['event']) + sync_events($channel,$arr['event']); + + if(array_key_exists('event_item',$arr) && $arr['event_item']) + sync_items($channel,$arr['event_item']); if(array_key_exists('item',$arr) && $arr['item']) sync_items($channel,$arr['item']); -- cgit v1.2.3 From 75d521d42affbafa34e87752deeb1961367de1d5 Mon Sep 17 00:00:00 2001 From: redmatrix Date: Tue, 8 Sep 2015 17:51:48 -0700 Subject: menu import and sync --- include/zot.php | 3 +++ 1 file changed, 3 insertions(+) (limited to 'include/zot.php') diff --git a/include/zot.php b/include/zot.php index 285668209..9fac4d40e 100644 --- a/include/zot.php +++ b/include/zot.php @@ -2896,6 +2896,9 @@ function process_channel_sync_delivery($sender, $arr, $deliveries) { if(array_key_exists('item_id',$arr) && $arr['item_id']) sync_items($channel,$arr['item_id']); + if(array_key_exists('menu',$arr) && $arr['menu']) + sync_menus($channel,$arr['menu']); + if(array_key_exists('channel',$arr) && is_array($arr['channel']) && count($arr['channel'])) { if(array_key_exists('channel_page_flags',$arr['channel']) && intval($arr['channel']['channel_pageflags'])) { $arr['channel']['channel_removed'] = (($arr['channel']['channel_pageflags'] & 0x8000) ? 1 : 0); -- cgit v1.2.3 From 50e32c3d8a9eb9d7b4c449224e0ad3da5d44f9e0 Mon Sep 17 00:00:00 2001 From: redmatrix Date: Thu, 10 Sep 2015 16:48:08 -0700 Subject: zot_refresh: always try the hubloc pointed to by xchan_addr first --- include/zot.php | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) (limited to 'include/zot.php') diff --git a/include/zot.php b/include/zot.php index 0376dc7f5..a81c13707 100644 --- a/include/zot.php +++ b/include/zot.php @@ -296,9 +296,18 @@ function zot_refresh($them, $channel = null, $force = false) { if ($them['hubloc_url']) { $url = $them['hubloc_url']; } else { - $r = q("select hubloc_url, hubloc_flags from hubloc where hubloc_hash = '%s'", - dbesc($them['xchan_hash']) - ); + $r = null; + + if(array_key_exists('xchan_addr',$them) && $them['xchan_addr']) { + $r = q("select hubloc_url, hubloc_flags from hubloc where hubloc_addr = '%s'", + dbesc($them['xchan_addr']) + ); + } + if(! $r) { + $r = q("select hubloc_url, hubloc_flags from hubloc where hubloc_hash = '%s'", + dbesc($them['xchan_hash']) + ); + } if ($r) { foreach ($r as $rr) { if ($rr['hubloc_flags'] & HUBLOC_FLAGS_PRIMARY) { -- cgit v1.2.3 From 00b480527a13d64299401292f2b6b1bb416f11c1 Mon Sep 17 00:00:00 2001 From: redmatrix Date: Thu, 10 Sep 2015 17:53:06 -0700 Subject: provide remote delivery report at logger_debug level --- include/zot.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'include/zot.php') diff --git a/include/zot.php b/include/zot.php index a5ddd661c..6b5ea4be3 100644 --- a/include/zot.php +++ b/include/zot.php @@ -972,7 +972,7 @@ function zot_process_response($hub, $arr, $outq) { ); } - logger('zot_process_response: ' . print_r($x,true), LOGGER_DATA); + logger('zot_process_response: ' . print_r($x,true), LOGGER_DEBUG); } /** @@ -2236,7 +2236,7 @@ function sync_locations($sender, $arr, $absolute = false) { // Absolute sync - make sure the current primary is correctly reflected in the xchan $pr = hubloc_change_primary($r[0]); if($pr) { - $what .= 'xchan_primary'; + $what .= 'xchan_primary '; $changed = true; } } -- cgit v1.2.3 From 4abfd4053a955a70c461290b7220145d2ce1a861 Mon Sep 17 00:00:00 2001 From: redmatrix Date: Thu, 10 Sep 2015 19:18:12 -0700 Subject: sync likes --- include/zot.php | 3 +++ 1 file changed, 3 insertions(+) (limited to 'include/zot.php') diff --git a/include/zot.php b/include/zot.php index 6b5ea4be3..0e00f39b4 100644 --- a/include/zot.php +++ b/include/zot.php @@ -2888,6 +2888,9 @@ function process_channel_sync_delivery($sender, $arr, $deliveries) { if(array_key_exists('obj',$arr) && $arr['obj']) sync_objs($channel,$arr['obj']); + if(array_key_exists('likes',$arr) && $arr['likes']) + import_likes($channel,$arr['likes']); + if(array_key_exists('app',$arr) && $arr['app']) sync_apps($channel,$arr['app']); -- cgit v1.2.3