aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorFriendika <info@friendika.com>2011-10-05 21:02:00 -0700
committerFriendika <info@friendika.com>2011-10-05 21:02:00 -0700
commitd0bef869dbd8d40f668f631a7875acd18886a464 (patch)
treef3b556688b022f81ed39e33361f490a21c41d6f9 /include
parent4c0ee7f41ffb614e0e25d9838d1dc0cc8c05ad1d (diff)
downloadvolse-hubzilla-d0bef869dbd8d40f668f631a7875acd18886a464.tar.gz
volse-hubzilla-d0bef869dbd8d40f668f631a7875acd18886a464.tar.bz2
volse-hubzilla-d0bef869dbd8d40f668f631a7875acd18886a464.zip
ensure D* photos only attached once
Diffstat (limited to 'include')
-rw-r--r--include/diaspora.php12
1 files changed, 7 insertions, 5 deletions
diff --git a/include/diaspora.php b/include/diaspora.php
index d4edc3f11..cdb1d6d11 100644
--- a/include/diaspora.php
+++ b/include/diaspora.php
@@ -762,11 +762,13 @@ function diaspora_photo($importer,$xml,$msg) {
$link_text = '[img]' . $remote_photo_path . $remote_photo_name . '[/img]' . "\n";
- $r = q("update item set `body` = '%s' where `id` = %d and `uid` = %d limit 1",
- dbesc($link_text . $parent_item['body']),
- intval($parent_item['id']),
- intval($parent_item['uid'])
- );
+ if(! strstr($parent_item['body'],$link_text)) {
+ $r = q("update item set `body` = '%s' where `id` = %d and `uid` = %d limit 1",
+ dbesc($link_text . $parent_item['body']),
+ intval($parent_item['id']),
+ intval($parent_item['uid'])
+ );
+ }
return;
}