define ( 'FRIENDICA_CODENAME', 'Asparagus');
define ( 'FRIENDICA_VERSION', '3.5.2-rc' );
define ( 'DFRN_PROTOCOL_VERSION', '2.23' );
-define ( 'DB_UPDATE_VERSION', 1224 );
+define ( 'DB_UPDATE_VERSION', 1225 );
/**
* @brief Constant with a HTML line break.
$database["conv"] = array(
"fields" => array(
"id" => array("type" => "int(10) unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1"),
- "guid" => array("type" => "varchar(64)", "not null" => "1", "default" => ""),
+ "guid" => array("type" => "varchar(255)", "not null" => "1", "default" => ""),
"recips" => array("type" => "text"),
"uid" => array("type" => "int(11)", "not null" => "1", "default" => "0", "relation" => array("user" => "uid")),
"creator" => array("type" => "varchar(255)", "not null" => "1", "default" => ""),
"fields" => array(
"id" => array("type" => "int(10) unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1"),
"uid" => array("type" => "int(10) unsigned", "not null" => "1", "default" => "0", "relation" => array("user" => "uid")),
- "guid" => array("type" => "varchar(64)", "not null" => "1", "default" => ""),
+ "guid" => array("type" => "varchar(255)", "not null" => "1", "default" => ""),
"from-name" => array("type" => "varchar(255)", "not null" => "1", "default" => ""),
"from-photo" => array("type" => "varchar(255)", "not null" => "1", "default" => ""),
"from-url" => array("type" => "varchar(255)", "not null" => "1", "default" => ""),
$message_id = self::message_exists($importer["uid"], $guid);
if ($message_id) {
- return $message_id;
+ return true;
}
$parent_item = self::parent_item($importer["uid"], $parent_guid, $author, $contact);
$message_id = item_store($datarray);
+ if ($message_id <= 0) {
+ return false;
+ }
+
if ($message_id) {
logger("Stored comment ".$datarray["guid"]." with message id ".$message_id, LOGGER_DEBUG);
}
proc_run(PRIORITY_HIGH, "include/notifier.php", "comment-import", $message_id);
}
- return $message_id;
+ return true;
}
/**
}
if (!$conversation) {
logger("unable to create conversation.");
- return;
+ return false;
}
foreach ($messages as $mesg)
$message_id = self::message_exists($importer["uid"], $guid);
if ($message_id)
- return $message_id;
+ return true;
$parent_item = self::parent_item($importer["uid"], $parent_guid, $author, $contact);
if (!$parent_item)
$message_id = item_store($datarray);
- if ($message_id)
+ if ($message_id <= 0) {
+ return false;
+ }
+
+ if ($message_id) {
logger("Stored like ".$datarray["guid"]." with message id ".$message_id, LOGGER_DEBUG);
+ }
// If we are the origin of the parent we store the original data and notify our followers
if ($message_id AND $parent_item["origin"]) {
proc_run(PRIORITY_HIGH, "include/notifier.php", "comment-import", $message_id);
}
- return $message_id;
+ return true;
}
/**
$message_id = self::message_exists($importer["uid"], $guid);
if ($message_id) {
- return $message_id;
+ return true;
}
$original_item = self::original_item($root_guid, $root_author, $author);
if ($message_id) {
logger("Stored reshare ".$datarray["guid"]." with message id ".$message_id, LOGGER_DEBUG);
+ return true;
+ } else {
+ return false;
}
-
- return $message_id;
}
/**
$message_id = self::message_exists($importer["uid"], $guid);
if ($message_id) {
- return $message_id;
+ return true;
}
$address = array();
if ($message_id) {
logger("Stored item ".$datarray["guid"]." with message id ".$message_id, LOGGER_DEBUG);
+ return true;
+ } else {
+ return false;
}
-
- return $message_id;
}
/* ************************************************************************************** *
logger('mod-diaspora: dispatching', LOGGER_DEBUG);
- $ret = 0;
+ $ret = true;
if ($public) {
Diaspora::dispatch_public($msg);
} else {
$ret = Diaspora::dispatch($importer, $msg);
}
- http_status_exit(($ret) ? $ret : 200);
+ http_status_exit(($ret) ? 200 : 500);
// NOTREACHED
}
<?php
-define('UPDATE_VERSION' , 1224);
+define('UPDATE_VERSION' , 1225);
/**
*