]> git.mxchange.org Git - friendica.git/commitdiff
Reliably show posts from contact
authorMichael <heluecht@pirati.ca>
Thu, 28 Sep 2017 06:01:31 +0000 (06:01 +0000)
committerMichael <heluecht@pirati.ca>
Thu, 28 Sep 2017 06:01:31 +0000 (06:01 +0000)
include/Contact.php
include/Smilies.php
object/Item.php

index 62122de6ce85f078090d29e66af2146456c3e176..956e5d0e11ad42141fd099c209998328d8848f8d 100644 (file)
@@ -576,6 +576,11 @@ function get_contact($url, $uid = 0, $no_update = false) {
                // Update the contact every 7 days
                $update_contact = ($contact['avatar-date'] < datetime_convert('','','now -7 days'));
 
+               // We force the update if the avatar is empty
+               if ($contact['avatar'] == '') {
+                       $update_contact = true;
+               }
+
                if (!$update_contact || $no_update) {
                        return $contact_id;
                }
@@ -747,7 +752,7 @@ function posts_from_contact_url(App $a, $contact_url) {
                WHERE `contact`.`nurl` = '%s' AND `contact`.`uid` = 0",
                dbesc(normalise_link($contact_url)));
        if (in_array($r[0]["network"], array(NETWORK_DFRN, NETWORK_DIASPORA, NETWORK_OSTATUS, ""))) {
-               $sql = "(`item`.`uid` = 0 OR (`item`.`uid` = %d AND `item`.`private`))";
+               $sql = "(`item`.`uid` = 0 OR (`item`.`uid` = %d AND NOT `item`.`global`))";
        } else {
                $sql = "`item`.`uid` = %d";
        }
index 8d527d7c82aa3e455f8525a2d978174c3e8f860e..01c1067d923f6bd97808213a9ff274423f0658cd 100644 (file)
@@ -6,6 +6,11 @@
  *
  * @todo Use the shortcodes from here:
  * https://github.com/iamcal/emoji-data/blob/master/emoji_pretty.json?raw=true
+ * https://raw.githubusercontent.com/emojione/emojione/master/extras/alpha-codes/eac.json?raw=true
+ * https://github.com/johannhof/emoji-helper/blob/master/data/emoji.json?raw=true
+ *
+ * Have also a look here:
+ * https://www.webpagefx.com/tools/emoji-cheat-sheet/
  */
 
 use Friendica\App;
index 495a4100cf355e0570449cb7922cc71aeab32dd4..4f89ea804c92eac4cdf3361a16a890b7e2e262ec 100644 (file)
@@ -96,12 +96,12 @@ class Item extends BaseObject {
 
                $item = $this->get_data();
                $edited = false;
-               // If the time between "created" and "editet" differes we add 
-               // a notices that the post was editet.
+               // If the time between "created" and "edited" differs we add
+               // a notice that the post was edited.
                // 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) {
+               if (strtotime($item['edited']) - strtotime($item['created']) > 1) {
                        $edited = array(
                                'label'    => t('This entry was edited'),
                                'date'     => datetime_convert('UTC', date_default_timezone_get(), $item['edited'], 'r'),