aboutsummaryrefslogtreecommitdiffstats
path: root/include/items.php
diff options
context:
space:
mode:
authorMike Macgirvin <mike@macgirvin.com>2010-09-09 19:48:08 -0700
committerMike Macgirvin <mike@macgirvin.com>2010-09-09 19:48:08 -0700
commit3a3bf273c71fc0acbe4681857d6e11f02826d1e7 (patch)
tree2499c7c06020b2f0bc3a3a1691dfe0067d712d47 /include/items.php
parent49c9860e6191ecebaa80c66e49b81132dd80990f (diff)
downloadvolse-hubzilla-3a3bf273c71fc0acbe4681857d6e11f02826d1e7.tar.gz
volse-hubzilla-3a3bf273c71fc0acbe4681857d6e11f02826d1e7.tar.bz2
volse-hubzilla-3a3bf273c71fc0acbe4681857d6e11f02826d1e7.zip
item cleanup
Diffstat (limited to 'include/items.php')
-rw-r--r--include/items.php62
1 files changed, 32 insertions, 30 deletions
diff --git a/include/items.php b/include/items.php
index acb9f6a06..7c1ef70df 100644
--- a/include/items.php
+++ b/include/items.php
@@ -34,8 +34,10 @@ function get_feed_for(&$a, $dfrn_id, $owner_id, $last_update) {
if($dfrn_id != '*') {
- $r = q("SELECT * FROM `contact` WHERE `issued-id` = '%s' LIMIT 1",
- dbesc($dfrn_id)
+ $r = q("SELECT * FROM `contact` WHERE ( `issued-id` = '%s' OR ( `duplex` = 1 AND `dfrn-id` = '%s' )) AND `uid` = %d LIMIT 1",
+ dbesc($dfrn_id),
+ dbesc($dfrn_id),
+ intval($owner_id)
);
if(! count($r))
return false;
@@ -124,7 +126,7 @@ function get_feed_for(&$a, $dfrn_id, $owner_id, $last_update) {
if($item['deleted']) {
$atom .= replace_macros($tomb_template, array(
- '$id' => xmlify($item['uri']),
+ '$id' => xmlify($item['uri']),
'$updated' => xmlify(datetime_convert('UTC', 'UTC', $item['edited'] . '+00:00' , ATOM_TIME))
));
}
@@ -134,38 +136,38 @@ function get_feed_for(&$a, $dfrn_id, $owner_id, $last_update) {
if($item['parent'] == $item['id']) {
$atom .= replace_macros($item_template, array(
- '$name' => xmlify($item['name']),
- '$profile_page' => xmlify($item['url']),
- '$thumb' => xmlify($item['thumb']),
- '$owner_name' => xmlify($item['owner-name']),
+ '$name' => xmlify($item['name']),
+ '$profile_page' => xmlify($item['url']),
+ '$thumb' => xmlify($item['thumb']),
+ '$owner_name' => xmlify($item['owner-name']),
'$owner_profile_page' => xmlify($item['owner-link']),
- '$owner_thumb' => xmlify($item['owner-avatar']),
- '$item_id' => xmlify($item['uri']),
- '$title' => xmlify($item['title']),
- '$published' => xmlify(datetime_convert('UTC', 'UTC', $item['created'] . '+00:00' , ATOM_TIME)),
- '$updated' => xmlify(datetime_convert('UTC', 'UTC', $item['edited'] . '+00:00' , ATOM_TIME)),
- '$location' => xmlify($item['location']),
- '$type' => $type,
- '$content' => xmlify($item['body']),
- '$verb' => xmlify($verb),
- '$actobj' => $actobj, // do not xmlify
- '$comment_allow' => ((($item['last-child']) && ($contact['rel']) && ($contact['rel'] != REL_FAN)) ? 1 : 0)
+ '$owner_thumb' => xmlify($item['owner-avatar']),
+ '$item_id' => xmlify($item['uri']),
+ '$title' => xmlify($item['title']),
+ '$published' => xmlify(datetime_convert('UTC', 'UTC', $item['created'] . '+00:00' , ATOM_TIME)),
+ '$updated' => xmlify(datetime_convert('UTC', 'UTC', $item['edited'] . '+00:00' , ATOM_TIME)),
+ '$location' => xmlify($item['location']),
+ '$type' => $type,
+ '$content' => xmlify($item['body']),
+ '$verb' => xmlify($verb),
+ '$actobj' => $actobj, // do not xmlify
+ '$comment_allow' => ((($item['last-child']) && ($contact['rel']) && ($contact['rel'] != REL_FAN)) ? 1 : 0)
));
}
else {
$atom .= replace_macros($cmnt_template, array(
- '$name' => xmlify($item['name']),
- '$profile_page' => xmlify($item['url']),
- '$thumb' => xmlify($item['thumb']),
- '$item_id' => xmlify($item['uri']),
- '$title' => xmlify($item['title']),
- '$published' => xmlify(datetime_convert('UTC', 'UTC', $item['created'] . '+00:00' , ATOM_TIME)),
- '$updated' => xmlify(datetime_convert('UTC', 'UTC', $item['edited'] . '+00:00' , ATOM_TIME)),
- '$type' => $type,
- '$content' =>xmlify($item['body']),
- '$verb' => xmlify($verb),
- '$actobj' => $actobj, // do not xmlify
- '$parent_id' => xmlify($item['parent-uri']),
+ '$name' => xmlify($item['name']),
+ '$profile_page' => xmlify($item['url']),
+ '$thumb' => xmlify($item['thumb']),
+ '$item_id' => xmlify($item['uri']),
+ '$title' => xmlify($item['title']),
+ '$published' => xmlify(datetime_convert('UTC', 'UTC', $item['created'] . '+00:00' , ATOM_TIME)),
+ '$updated' => xmlify(datetime_convert('UTC', 'UTC', $item['edited'] . '+00:00' , ATOM_TIME)),
+ '$type' => $type,
+ '$content' => xmlify($item['body']),
+ '$verb' => xmlify($verb),
+ '$actobj' => $actobj, // do not xmlify
+ '$parent_id' => xmlify($item['parent-uri']),
'$comment_allow' => (($item['last-child']) ? 1 : 0)
));
}