Merge pull request #2130 from annando/1512-contact-rework

Some more contact rework
This commit is contained in:
Tobias Diekershoff 2015-12-04 06:53:29 +01:00
commit eaf975faae
10 changed files with 106 additions and 80 deletions

View file

@ -1250,8 +1250,10 @@ function item_store($arr,$force_parent = false, $notify = false, $dontcache = fa
if ($notify)
$guid_prefix = "";
else
$guid_prefix = $arr['network'];
else {
$parsed = parse_url($arr["author-link"]);
$guid_prefix = hash("crc32", $parsed["host"]);
}
$arr['wall'] = ((x($arr,'wall')) ? intval($arr['wall']) : 0);
$arr['guid'] = ((x($arr,'guid')) ? notags(trim($arr['guid'])) : get_guid(32, $guid_prefix));
@ -2320,6 +2322,9 @@ function edited_timestamp_is_newer($existing, $update) {
function consume_feed($xml,$importer,&$contact, &$hub, $datedir = 0, $pass = 0) {
if ($contact['network'] === NETWORK_OSTATUS) {
if ($pass < 2) {
// Test - remove before flight
//$tempfile = tempnam(get_temppath(), "ostatus2");
//file_put_contents($tempfile, $xml);
logger("Consume OStatus messages ", LOGGER_DEBUG);
ostatus_import($xml,$importer,$contact, $hub);
}

View file

@ -1282,6 +1282,14 @@ function ostatus_add_author($doc, $owner, $profile) {
return $author;
}
/*
To-Do: Picture attachments should look like this:
<a href="https://status.pirati.ca/attachment/572819" title="https://status.pirati.ca/file/heluecht-20151202T222602-rd3u49p.gif"
class="attachment thumbnail" id="attachment-572819" rel="nofollow external">https://status.pirati.ca/attachment/572819</a>
*/
function ostatus_entry($doc, $item, $owner, $toplevel = false) {
$a = get_app();