aboutsummaryrefslogtreecommitdiffstats
path: root/include/items.php
diff options
context:
space:
mode:
authorFabio Comuni <fabrix.xm@gmail.com>2012-03-06 09:48:08 +0100
committerFabio Comuni <fabrix.xm@gmail.com>2012-03-06 09:48:08 +0100
commitbe9985a3aed1bfbbc6964973e2f12d0bd7928c04 (patch)
tree4fc044f6200f010778363a8de72671f45c259eaa /include/items.php
parent8a51e29824fc2569ac1d0def3070bee7c0552231 (diff)
parentd04fba704861fa27184346d0cefe2069ec8cfa6d (diff)
downloadvolse-hubzilla-be9985a3aed1bfbbc6964973e2f12d0bd7928c04.tar.gz
volse-hubzilla-be9985a3aed1bfbbc6964973e2f12d0bd7928c04.tar.bz2
volse-hubzilla-be9985a3aed1bfbbc6964973e2f12d0bd7928c04.zip
Merge remote-tracking branch 'friendica/master'
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;
}