aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFriendika <info@friendika.com>2011-10-19 15:18:41 -0700
committerFriendika <info@friendika.com>2011-10-19 15:18:41 -0700
commit10b2661176e941b0552656ee60055a8ac7fe992a (patch)
treef65465555c3c48e5b6b68e4b6eb7139f2aeefb6c
parent19129e06c39da10b7b026ab8c2176322102a95cf (diff)
downloadvolse-hubzilla-10b2661176e941b0552656ee60055a8ac7fe992a.tar.gz
volse-hubzilla-10b2661176e941b0552656ee60055a8ac7fe992a.tar.bz2
volse-hubzilla-10b2661176e941b0552656ee60055a8ac7fe992a.zip
suppress blank diaspora messages which are awaiting a photo that hasn't arrived
-rw-r--r--include/diaspora.php6
1 files changed, 5 insertions, 1 deletions
diff --git a/include/diaspora.php b/include/diaspora.php
index aa6ee9670..be79e7a5d 100644
--- a/include/diaspora.php
+++ b/include/diaspora.php
@@ -570,6 +570,10 @@ function diaspora_post($importer,$xml) {
$datarray['tag'] = $str_tags;
$datarray['app'] = 'Diaspora';
+ // if empty content it might be a photo that hasn't arrived yet. If a photo arrives, we'll make it visible.
+
+ $datarray['visible'] = ((strlen($body)) ? 1 : 0);
+
$message_id = item_store($datarray);
if($message_id) {
@@ -1007,7 +1011,7 @@ function diaspora_photo($importer,$xml,$msg) {
$link_text = '[img]' . $remote_photo_path . $remote_photo_name . '[/img]' . "\n";
if(strpos($parent_item['body'],$link_text) === false) {
- $r = q("update item set `body` = '%s' where `id` = %d and `uid` = %d limit 1",
+ $r = q("update item set `body` = '%s', `visible` = 1 where `id` = %d and `uid` = %d limit 1",
dbesc($link_text . $parent_item['body']),
intval($parent_item['id']),
intval($parent_item['uid'])