Removed just more old diaspora function calls.
This commit is contained in:
		
					parent
					
						
							
								2446c56e50
							
						
					
				
			
			
				commit
				
					
						07bd89c35f
					
				
			
		
					 13 changed files with 8 additions and 109 deletions
				
			
		
							
								
								
									
										11
									
								
								database.sql
									
										
									
									
									
								
							
							
						
						
									
										11
									
								
								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
 | 
			
		||||
--
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -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                          |
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -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)
 | 
			
		||||
| 
						 | 
				
			
			@ -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");
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -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"),
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -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;
 | 
			
		||||
				}
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -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
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -1,55 +0,0 @@
 | 
			
		|||
<?php
 | 
			
		||||
require_once("boot.php");
 | 
			
		||||
require_once('include/diaspora.php');
 | 
			
		||||
 | 
			
		||||
function dsprphotoq_run($argv, $argc){
 | 
			
		||||
	global $a, $db;
 | 
			
		||||
 | 
			
		||||
	if(is_null($a)){
 | 
			
		||||
		$a = new App;
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	if(is_null($db)){
 | 
			
		||||
		@include(".htconfig.php");
 | 
			
		||||
		require_once("include/dba.php");
 | 
			
		||||
		$db = new dba($db_host, $db_user, $db_pass, $db_data);
 | 
			
		||||
		unset($db_host, $db_user, $db_pass, $db_data);
 | 
			
		||||
	};
 | 
			
		||||
 | 
			
		||||
	logger("diaspora photo queue: running", LOGGER_DEBUG);
 | 
			
		||||
 | 
			
		||||
	$r = q("SELECT * FROM dsprphotoq");
 | 
			
		||||
	if(!$r)
 | 
			
		||||
		return;
 | 
			
		||||
 | 
			
		||||
	$dphotos = $r;
 | 
			
		||||
 | 
			
		||||
	logger("diaspora photo queue: processing " . count($dphotos) . " photos");
 | 
			
		||||
 | 
			
		||||
	foreach($dphotos as $dphoto) {
 | 
			
		||||
 | 
			
		||||
		$r = array();
 | 
			
		||||
 | 
			
		||||
		if ($dphoto['uid'] == 0)
 | 
			
		||||
			$r[0] = array("uid" => 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();
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			@ -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);
 | 
			
		||||
		}
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -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...
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -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"];
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -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);
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -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
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue