]> git.mxchange.org Git - friendica.git/blobdiff - object/Item.php
add a comment as explanation for #3737
[friendica.git] / object / Item.php
index f81b8ea4e8a13be43206444663bc8bb92685e6d9..495a4100cf355e0570449cb7922cc71aeab32dd4 100644 (file)
@@ -68,6 +68,11 @@ class Item extends BaseObject {
                                        continue;
                                }
 
+                               // You can always comment on Diaspora items
+                               if (($item['network'] == NETWORK_DIASPORA) && (local_user() == $item['uid'])) {
+                                       $item['writable'] = true;
+                               }
+
                                $item['pagedrop'] = $data['pagedrop'];
                                $child = new Item($item);
                                $this->add_child($child);
@@ -91,7 +96,12 @@ class Item extends BaseObject {
 
                $item = $this->get_data();
                $edited = false;
-               if (strcmp($item['created'], $item['edited'])<>0) {
+               // If the time between "created" and "editet" differes we add 
+               // a notices that the post was editet.
+               // Note: In some networks reshared items seem to have (sometimes) a difference
+               // between creation time and edit time of a second. Thats why we add the notice
+               // only if the difference is more than 1 second.
+               if (abs(strtotime($item['created']) - strtotime($item['edited'])) > 1) {
                        $edited = array(
                                'label'    => t('This entry was edited'),
                                'date'     => datetime_convert('UTC', date_default_timezone_get(), $item['edited'], 'r'),
@@ -319,18 +329,6 @@ class Item extends BaseObject {
                        unset($buttons["like"]);
                }
 
-               // Diaspora isn't able to do likes on comments - but Hubzilla does
-               /// @todo When Diaspora will pass this information we will remove these lines
-               if (($item["item_network"] == NETWORK_DIASPORA) && ($indent == 'comment') &&
-                       !Diaspora::is_redmatrix($item["owner-link"]) && isset($buttons["like"])) {
-                       unset($buttons["like"]);
-               }
-
-               // Facebook can like comments - but it isn't programmed in the connector yet.
-               if (($item["item_network"] == NETWORK_FACEBOOK) && ($indent == 'comment') && isset($buttons["like"])) {
-                       unset($buttons["like"]);
-               }
-
                $tmp_item = array(
                        'template'        => $this->get_template(),
                        'type'            => implode("",array_slice(explode("/",$item['verb']),-1)),