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));
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);
}
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();
intval($a->pager['itemspage'])
);
- if (!$r)
- $o = $contact["url"]." - ".$contact_id;
-
- $tab_str = contact_tabs($a, $contact_id, 1);
+ $tab_str = contacts_tab($a, $contact_id, 1);
- $header = $contact["name"];
-
- if ($contact["addr"] != "")
- $header .= " <".$contact["addr"].">";
-
- $header .= " (".network_to_name($contact['network'], $contact['url']).")";
-
- //$tpl = get_markup_template("section_title.tpl");
- //$o = replace_macros($tpl,array(
- // '$title' => htmlentities($header)
- //));
-
$o .= $tab_str;
$o .= conversation($a,$r,'community',false);
$a->page['aside'] = '';
if($contact_id) {
-- $a->data['contact'] = $r[0];
- $tpl = get_markup_template("vcard-widget.tpl");
- $vcard_widget .= replace_macros($tpl, array(
- '$name' => htmlentities($a->data['contact']['name']),
- '$photo' => $a->data['contact']['photo']
- ));
-
- if (($a->data['contact']['network'] != "") AND ($a->data['contact']['network'] != NETWORK_DFRN)) {
- $networkname = format_network_name($a->data['contact']['network'],$a->data['contact']['url']);
- } else
- $networkname = '';
-
- $vcard_widget = replace_macros(get_markup_template("vcard-widget.tpl"),array(
- '$name' => htmlentities($a->data['contact']['name']),
- '$photo' => $a->data['contact']['photo'],
- '$url' => ($a->data['contact']['network'] == NETWORK_DFRN) ? z_root()."/redir/".$a->data['contact']['id'] : $a->data['contact']['url'],
- '$addr' => (($a->data['contact']['addr'] != "") ? ($a->data['contact']['addr']) : ""),
- '$network_name' => $networkname,
- '$network' => t('Network:'),
- 'account_type' => (($a->data['contact']['forum'] || $a->data['contact']['prv']) ? t('Forum') : '')
- ));
-
-- $a->page['aside'] .= $vcard_widget;
--
++ $a->data['contact'] = $r[0];
++ $contact = $r[0];
++ profile_load($a, "", 0, get_contact_details_by_url($contact["url"]));
}
}
$update_profile = in_array($contact['network'], array(NETWORK_DFRN, NETWORK_DSPR, NETWORK_OSTATUS));
- $tab_str = contact_tabs($a, $contact['id'], 3);
+ $tab_str = contacts_tab($a, $contact['id'], 5);
- $header = $contact["name"];
-
- if ($contact["addr"] != "")
- $header .= " <".$contact["addr"].">";
-
- $header .= " (".network_to_name($contact['network'], $contact['url']).")";
$tpl = get_markup_template('crepair.tpl');
$o .= replace_macros($tpl, array(