From 56cb6cc8972f55d82030c8c2b908b05e656640f6 Mon Sep 17 00:00:00 2001 From: Michael Vogel Date: Mon, 14 Mar 2016 20:53:44 +0100 Subject: [PATCH] Removed just more old diaspora function calls. --- database.sql | 11 ------- doc/database.md | 1 - doc/database/db_dsprphotoq.md | 11 ------- include/cron.php | 4 --- include/dbstructure.php | 11 ------- include/delivery.php | 5 ---- include/diaspora2.php | 2 +- include/dsprphotoq.php | 55 ----------------------------------- include/follow.php | 2 +- mod/dfrn_confirm.php | 4 +-- mod/p.php | 6 ++-- mod/receive.php | 3 -- object/Item.php | 2 +- 13 files changed, 8 insertions(+), 109 deletions(-) delete mode 100644 doc/database/db_dsprphotoq.md delete mode 100644 include/dsprphotoq.php diff --git a/database.sql b/database.sql index 25faf0f4c0..02e5c9b378 100644 --- a/database.sql +++ b/database.sql @@ -201,17 +201,6 @@ CREATE TABLE IF NOT EXISTS `deliverq` ( PRIMARY KEY(`id`) ) DEFAULT CHARSET=utf8; --- --- TABLE dsprphotoq --- -CREATE TABLE IF NOT EXISTS `dsprphotoq` ( - `id` int(10) unsigned NOT NULL auto_increment, - `uid` int(11) NOT NULL DEFAULT 0, - `msg` mediumtext NOT NULL, - `attempt` tinyint(4) NOT NULL DEFAULT 0, - PRIMARY KEY(`id`) -) DEFAULT CHARSET=utf8; - -- -- TABLE event -- diff --git a/doc/database.md b/doc/database.md index e37df05e09..f48404c17d 100644 --- a/doc/database.md +++ b/doc/database.md @@ -15,7 +15,6 @@ Database Tables | [contact](help/database/db_contact) | contact table | | [conv](help/database/db_conv) | private messages | | [deliverq](help/database/db_deliverq) | | -| [dsprphotoq](help/database/db_dsprphotoq) | | | [event](help/database/db_event) | Events | | [fcontact](help/database/db_fcontact) | friend suggestion stuff | | [ffinder](help/database/db_ffinder) | friend suggestion stuff | diff --git a/doc/database/db_dsprphotoq.md b/doc/database/db_dsprphotoq.md deleted file mode 100644 index 6af4d030e0..0000000000 --- a/doc/database/db_dsprphotoq.md +++ /dev/null @@ -1,11 +0,0 @@ -Table dsprphotoq -================ - -| Field | Description | Type | Null | Key | Default | Extra | -|---------|------------------|------------------|------|-----|---------|----------------| -| id | sequential ID | int(10) unsigned | NO | PRI | NULL | auto_increment | -| uid | | int(11) | NO | | 0 | | -| msg | | mediumtext | NO | | NULL | | -| attempt | | tinyint(4) | NO | | 0 | | - -Return to [database documentation](help/database) diff --git a/include/cron.php b/include/cron.php index db7d44be0b..60c62786e6 100644 --- a/include/cron.php +++ b/include/cron.php @@ -71,10 +71,6 @@ function cron_run(&$argv, &$argc){ proc_run('php',"include/queue.php"); - // run diaspora photo queue process in the background - - proc_run('php',"include/dsprphotoq.php"); - // run the process to discover global contacts in the background proc_run('php',"include/discover_poco.php"); diff --git a/include/dbstructure.php b/include/dbstructure.php index ddf036f2c1..e5e748bb24 100644 --- a/include/dbstructure.php +++ b/include/dbstructure.php @@ -537,17 +537,6 @@ function db_definition() { "PRIMARY" => array("id"), ) ); - $database["dsprphotoq"] = array( - "fields" => array( - "id" => array("type" => "int(10) unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1"), - "uid" => array("type" => "int(11)", "not null" => "1", "default" => "0"), - "msg" => array("type" => "mediumtext", "not null" => "1"), - "attempt" => array("type" => "tinyint(4)", "not null" => "1", "default" => "0"), - ), - "indexes" => array( - "PRIMARY" => array("id"), - ) - ); $database["event"] = array( "fields" => array( "id" => array("type" => "int(11)", "not null" => "1", "extra" => "auto_increment", "primary" => "1"), diff --git a/include/delivery.php b/include/delivery.php index 1e1dadcd93..9ac9f2391b 100644 --- a/include/delivery.php +++ b/include/delivery.php @@ -501,7 +501,6 @@ function delivery_run(&$argv, &$argc){ if ($mail) { diaspora::send_mail($item,$owner,$contact); - //diaspora_send_mail($item,$owner,$contact); break; } @@ -524,25 +523,21 @@ function delivery_run(&$argv, &$argc){ // top-level retraction logger('diaspora retract: '.$loc); diaspora::send_retraction($target_item,$owner,$contact,$public_message); - //diaspora_send_retraction($target_item,$owner,$contact,$public_message); break; } elseif ($followup) { // send comments and likes to owner to relay logger('diaspora followup: '.$loc); diaspora::send_followup($target_item,$owner,$contact,$public_message); - //diaspora_send_followup($target_item,$owner,$contact,$public_message); break; } elseif ($target_item['uri'] !== $target_item['parent-uri']) { // we are the relay - send comments, likes and relayable_retractions to our conversants logger('diaspora relay: '.$loc); diaspora::send_relay($target_item,$owner,$contact,$public_message); - //diaspora_send_relay($target_item,$owner,$contact,$public_message); break; } elseif ($top_level && !$walltowall) { // currently no workable solution for sending walltowall logger('diaspora status: '.$loc); diaspora::send_status($target_item,$owner,$contact,$public_message); - //diaspora_send_status($target_item,$owner,$contact,$public_message); break; } diff --git a/include/diaspora2.php b/include/diaspora2.php index c0e054c384..1a354e9cf2 100644 --- a/include/diaspora2.php +++ b/include/diaspora2.php @@ -2093,7 +2093,7 @@ class diaspora { return self::build_and_transmit($owner, $contact, "retraction", $message); } - private function is_reshare($body) { + public static function is_reshare($body) { $body = trim($body); // Skip if it isn't a pure repeated messages diff --git a/include/dsprphotoq.php b/include/dsprphotoq.php deleted file mode 100644 index 0d8088d4bd..0000000000 --- a/include/dsprphotoq.php +++ /dev/null @@ -1,55 +0,0 @@ - 0, "page-flags" => PAGE_FREELOVE); - else - $r = q("SELECT * FROM user WHERE uid = %d", - intval($dphoto['uid'])); - - if(!$r) { - logger("diaspora photo queue: user " . $dphoto['uid'] . " not found"); - return; - } - - $ret = diaspora_dispatch($r[0],unserialize($dphoto['msg']),$dphoto['attempt']); - q("DELETE FROM dsprphotoq WHERE id = %d", - intval($dphoto['id']) - ); - } -} - - -if (array_search(__file__,get_included_files())===0){ - dsprphotoq_run($_SERVER["argv"],$_SERVER["argc"]); - killme(); -} diff --git a/include/follow.php b/include/follow.php index 6eab7e12fa..d0411a466a 100644 --- a/include/follow.php +++ b/include/follow.php @@ -304,7 +304,7 @@ function new_contact($uid,$url,$interactive = false) { if($contact['network'] == NETWORK_DIASPORA) { require_once('include/diaspora.php'); $ret = diaspora::send_share($a->user,$contact); - logger('mod_follow: diaspora_share returns: ' . $ret); + logger('share returns: '.$ret); } } diff --git a/mod/dfrn_confirm.php b/mod/dfrn_confirm.php index 68950ec285..cc09021dca 100644 --- a/mod/dfrn_confirm.php +++ b/mod/dfrn_confirm.php @@ -427,8 +427,8 @@ function dfrn_confirm_post(&$a,$handsfree = null) { if(($contact) && ($contact['network'] === NETWORK_DIASPORA)) { require_once('include/diaspora.php'); - $ret = diaspora_share($user[0],$r[0]); - logger('mod_follow: diaspora_share returns: ' . $ret); + $ret = diaspora::send_share($user[0],$r[0]); + logger('share returns: ' . $ret); } // Send a new friend post if we are allowed to... diff --git a/mod/p.php b/mod/p.php index 92b72dc1ce..20d6cfdbaf 100644 --- a/mod/p.php +++ b/mod/p.php @@ -28,14 +28,14 @@ function p_init($a){ $post = array(); - $reshared = diaspora_is_reshare($item[0]["body"]); + $reshared = diaspora::is_reshare($item[0]["body"]); if ($reshared) { $nodename = "reshare"; $post["root_diaspora_id"] = $reshared["root_handle"]; $post["root_guid"] = $reshared["root_guid"]; $post["guid"] = $item[0]["guid"]; - $post["diaspora_handle"] = diaspora_handle_from_contact($item[0]["contact-id"]); + $post["diaspora_handle"] = diaspora::handle_from_contact($item[0]["contact-id"]); $post["public"] = (!$item[0]["private"] ? 'true':'false'); $post["created_at"] = datetime_convert('UTC','UTC',$item[0]["created"]); } else { @@ -48,7 +48,7 @@ function p_init($a){ $nodename = "status_message"; $post["raw_message"] = str_replace("&", "&", $body); $post["guid"] = $item[0]["guid"]; - $post["diaspora_handle"] = diaspora_handle_from_contact($item[0]["contact-id"]); + $post["diaspora_handle"] = diaspora::handle_from_contact($item[0]["contact-id"]); $post["public"] = (!$item[0]["private"] ? 'true':'false'); $post["created_at"] = datetime_convert('UTC','UTC',$item[0]["created"]); $post["provider_display_name"] = $item[0]["app"]; diff --git a/mod/receive.php b/mod/receive.php index 051ea8c25c..4991ac47e8 100644 --- a/mod/receive.php +++ b/mod/receive.php @@ -54,7 +54,6 @@ function receive_post(&$a) { logger('mod-diaspora: message is okay', LOGGER_DEBUG); $msg = diaspora::decode($importer,$xml); - //$msg = diaspora_decode($importer,$xml); logger('mod-diaspora: decoded', LOGGER_DEBUG); @@ -68,10 +67,8 @@ function receive_post(&$a) { $ret = 0; if($public) { diaspora::dispatch_public($msg); - //diaspora_dispatch_public($msg); } else { $ret = diaspora::dispatch($importer,$msg); - //$ret = diaspora_dispatch($importer,$msg); } http_status_exit(($ret) ? $ret : 200); diff --git a/object/Item.php b/object/Item.php index e9c96cf159..59659cdaff 100644 --- a/object/Item.php +++ b/object/Item.php @@ -324,7 +324,7 @@ class Item extends BaseObject { // Diaspora isn't able to do likes on comments - but red does if (($item["item_network"] == NETWORK_DIASPORA) AND ($indent == 'comment') AND - !diaspora_is_redmatrix($item["owner-link"]) AND isset($buttons["like"])) + !diaspora::is_redmatrix($item["owner-link"]) AND isset($buttons["like"])) unset($buttons["like"]); // Diaspora doesn't has multithreaded comments