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
--
| [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 |
+++ /dev/null
-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)
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");
"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"),
if ($mail) {
diaspora::send_mail($item,$owner,$contact);
- //diaspora_send_mail($item,$owner,$contact);
break;
}
// 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;
}
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
+++ /dev/null
-<?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();
-}
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);
}
}
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...
$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 {
$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"];
logger('mod-diaspora: message is okay', LOGGER_DEBUG);
$msg = diaspora::decode($importer,$xml);
- //$msg = diaspora_decode($importer,$xml);
logger('mod-diaspora: decoded', LOGGER_DEBUG);
$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);
// 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