Merge remote-tracking branch 'upstream/develop' into 1606-contact-id

This commit is contained in:
Michael Vogel 2016-06-21 00:10:24 +02:00
commit 266fea3874
2 changed files with 25 additions and 4 deletions

View file

@ -981,6 +981,23 @@ class diaspora {
return true;
}
/**
* @brief Fetch the uri from our database if we already have this item (maybe from ourselves)
*
* @param string $author Author handle
* @param string $guid Message guid
*
* @return string The constructed uri or the one from our database
*/
private function get_uri_from_guid($author, $guid) {
$r = q("SELECT `uri` FROM `item` WHERE `guid` = '%s' LIMIT 1", dbesc($guid));
if ($r)
return $r[0]["uri"];
else
return $author.":".$guid;
}
/**
* @brief Processes an incoming comment
*
@ -1033,7 +1050,7 @@ class diaspora {
$datarray["owner-avatar"] = ((x($contact,"thumb")) ? $contact["thumb"] : $contact["photo"]);
$datarray["guid"] = $guid;
$datarray["uri"] = $author.":".$guid;
$datarray["uri"] = self::get_uri_from_guid($author, $guid);
$datarray["type"] = "remote-comment";
$datarray["verb"] = ACTIVITY_POST;
@ -1370,7 +1387,7 @@ class diaspora {
$datarray["owner-avatar"] = ((x($contact,"thumb")) ? $contact["thumb"] : $contact["photo"]);
$datarray["guid"] = $guid;
$datarray["uri"] = $author.":".$guid;
$datarray["uri"] = self::get_uri_from_guid($author, $guid);
$datarray["type"] = "activity";
$datarray["verb"] = $verb;
@ -1969,7 +1986,7 @@ class diaspora {
$datarray["owner-avatar"] = $datarray["author-avatar"];
$datarray["guid"] = $guid;
$datarray["uri"] = $datarray["parent-uri"] = $author.":".$guid;
$datarray["uri"] = $datarray["parent-uri"] = self::get_uri_from_guid($author, $guid);
$datarray["verb"] = ACTIVITY_POST;
$datarray["gravity"] = GRAVITY_PARENT;
@ -2171,7 +2188,7 @@ class diaspora {
$datarray["owner-avatar"] = $datarray["author-avatar"];
$datarray["guid"] = $guid;
$datarray["uri"] = $datarray["parent-uri"] = $author.":".$guid;
$datarray["uri"] = $datarray["parent-uri"] = self::get_uri_from_guid($author, $guid);
$datarray["verb"] = ACTIVITY_POST;
$datarray["gravity"] = GRAVITY_PARENT;

View file

@ -12,6 +12,10 @@ $frio = "view/theme/frio";
global $frio;
function frio_init(&$a) {
// disable the events module link in the profile tab
$a->theme_events_in_profile = false;
set_template_engine($a, 'smarty3');
$baseurl = $a->get_baseurl();