aboutsummaryrefslogtreecommitdiffstats
path: root/include/items.php
diff options
context:
space:
mode:
authorfriendica <info@friendica.com>2012-03-04 18:50:32 -0800
committerfriendica <info@friendica.com>2012-03-04 18:50:32 -0800
commitfba089012a3b4cd8c2969e111173bab0d58b6750 (patch)
tree9316aee6324d7aac60d34b0dd459253c08c90143 /include/items.php
parent4134fd3dcee1b26b888c89c47f798fd3fd058064 (diff)
downloadvolse-hubzilla-fba089012a3b4cd8c2969e111173bab0d58b6750.tar.gz
volse-hubzilla-fba089012a3b4cd8c2969e111173bab0d58b6750.tar.bz2
volse-hubzilla-fba089012a3b4cd8c2969e111173bab0d58b6750.zip
correct owner info from misconfigured installs, duepuntozero title block misplaced in editplain mode
Diffstat (limited to 'include/items.php')
-rwxr-xr-xinclude/items.php24
1 files changed, 24 insertions, 0 deletions
diff --git a/include/items.php b/include/items.php
index a1254e165..3c55fbb4f 100755
--- a/include/items.php
+++ b/include/items.php
@@ -1747,6 +1747,18 @@ function consume_feed($xml,$importer,&$contact, &$hub, $datedir = 0, $pass = 0)
$datarray['parent-uri'] = $item_id;
$datarray['uid'] = $importer['uid'];
$datarray['contact-id'] = $contact['id'];
+
+ if(x($datarray,'owner-link') && strlen($datarray['owner-link']) && (! link_compare($datarray['owner-link'],$contact['url']))) {
+ // The item owner info is not our contact. It's OK and is to be expected if this is a tgroup delivery,
+ // but otherwise there's a possible data mixup on the sender's system.
+ // the tgroup delivery code called from item_store will correct it if it's a forum,
+ // but we're going to unconditionally correct it here so that the post will always be owned by our contact.
+ logger('local_delivery: Correcting item owner.', LOGGER_DEBUG);
+ $datarray['owner-name'] = $contact['name'];
+ $datarray['owner-link'] = $contact['url'];
+ $datarray['owner-avatar'] = $contact['thumb'];
+ }
+
$r = item_store($datarray);
continue;
@@ -2439,6 +2451,18 @@ function local_delivery($importer,$data) {
$datarray['parent-uri'] = $item_id;
$datarray['uid'] = $importer['importer_uid'];
$datarray['contact-id'] = $importer['id'];
+
+ if(x($datarray,'owner-link') && strlen($datarray['owner-link']) && (! link_compare($datarray['owner-link'],$importer['url']))) {
+ // The item owner info is not our contact. It's OK and is to be expected if this is a tgroup delivery,
+ // but otherwise there's a possible data mixup on the sender's system.
+ // the tgroup delivery code called from item_store will correct it if it's a forum,
+ // but we're going to unconditionally correct it here so that the post will always be owned by our contact.
+ logger('local_delivery: Correcting item owner.', LOGGER_DEBUG);
+ $datarray['owner-name'] = $importer['senderName'];
+ $datarray['owner-link'] = $importer['url'];
+ $datarray['owner-avatar'] = $importer['thumb'];
+ }
+
$r = item_store($datarray);
continue;
}