aboutsummaryrefslogtreecommitdiffstats
path: root/include/zot.php
diff options
context:
space:
mode:
authorfriendica <info@friendica.com>2014-05-29 16:14:10 -0700
committerfriendica <info@friendica.com>2014-05-29 16:14:10 -0700
commit9b5eabf1083602382385c62c6ad7d8ae8e167f9e (patch)
treea73ed07970a517dbad90f14954fea790193813c3 /include/zot.php
parenta00103b7dfa0b128cbe6ab03e6a43ccedb24f8c2 (diff)
parent1a58777daa0ab9394f38737a806a7a185ebceeb0 (diff)
downloadvolse-hubzilla-9b5eabf1083602382385c62c6ad7d8ae8e167f9e.tar.gz
volse-hubzilla-9b5eabf1083602382385c62c6ad7d8ae8e167f9e.tar.bz2
volse-hubzilla-9b5eabf1083602382385c62c6ad7d8ae8e167f9e.zip
Merge branch 'master' into newevent
Conflicts: include/zot.php
Diffstat (limited to 'include/zot.php')
-rw-r--r--include/zot.php22
1 files changed, 21 insertions, 1 deletions
diff --git a/include/zot.php b/include/zot.php
index 7336c4290..8c50d723d 100644
--- a/include/zot.php
+++ b/include/zot.php
@@ -840,6 +840,24 @@ function import_xchan($arr,$ud_flags = UPDATE_FLAGS_UPDATED) {
intval($r[0]['hubloc_id'])
);
}
+ if($r[0]['hubloc_status'] & HUBLOC_OFFLINE) {
+ q("update hubloc set hubloc_status = (hubloc_status ^ %d) where hubloc_id = %d limit 1",
+ intval(HUBLOC_OFFLINE),
+ intval($r[0]['hubloc_id'])
+ );
+ if($r[0]['hubloc_flags'] & HUBLOC_FLAGS_ORPHANCHECK) {
+ q("update hubloc set hubloc_flags = (hubloc_flags ^ %d) where hubloc_id = %d limit 1",
+ intval(HUBLOC_FLAGS_ORPHANCHECK),
+ intval($r[0]['hubloc_id'])
+ );
+ }
+ q("update xchan set xchan_flags = (xchan_flags ^ %d) where (xchan_flags & %d) and xchan_hash = '%s' limit 1",
+ intval(XCHAN_FLAGS_ORPHAN),
+ intval(XCHAN_FLAGS_ORPHAN),
+ dbesc($xchan_hash)
+ );
+
+ }
// Remove pure duplicates
if(count($r) > 1) {
@@ -1452,7 +1470,6 @@ function process_delivery($sender,$arr,$deliveries,$relay,$public = false) {
continue;
}
-
$r = q("select id, edited from item where mid = '%s' and uid = %d limit 1",
dbesc($arr['mid']),
intval($channel['channel_id'])
@@ -1471,6 +1488,9 @@ function process_delivery($sender,$arr,$deliveries,$relay,$public = false) {
$arr['uid'] = $channel['channel_id'];
$item_result = item_store($arr);
$item_id = $item_result['item_id'];
+ $parr = array('item_id' => $item_id,'item' => $arr,'sender' => $sender,'channel' => $channel);
+ call_hooks('activity_received',$parr);
+
add_source_route($item_id,$sender['hash']);
$result[] = array($d['hash'],(($item_id) ? 'posted' : 'storage failed:' . $item_result['message']),$channel['channel_name'] . ' <' . $channel['channel_address'] . '@' . get_app()->get_hostname() . '>',$arr['mid']);