]> git.mxchange.org Git - friendica.git/commitdiff
Merge pull request #6726 from MrPetovan/task/6676-fix-implicit-mentions
authorMichael Vogel <icarus@dabo.de>
Sun, 24 Feb 2019 14:40:11 +0000 (15:40 +0100)
committerGitHub <noreply@github.com>
Sun, 24 Feb 2019 14:40:11 +0000 (15:40 +0100)
Fix last batch of implicit mentions issues

1  2 
src/Model/Contact.php

diff --combined src/Model/Contact.php
index bf7d806db96a1c51fd4c2d069a8cf7cbe1f0aec4,5f63d89d0f974243d6f2ea7de78212c8ce14e54e..6e83b76e6fe3024cb139fa7ccb9c6d4123a9f62b
@@@ -232,11 -232,6 +232,11 @@@ class Contact extends BaseObjec
                }
  
                DBA::update('user-contact', ['blocked' => $blocked], ['cid' => $cdata['public'], 'uid' => $uid], true);
 +
 +              if ($blocked) {
 +                      // Blocked contact can't be in any group
 +                      self::removeFromGroups($cid);
 +              }
        }
  
        /**
        {
                $contact = DBA::selectFirst('contact', ['id', 'network', 'url', 'uid'], ['id' => $cid]);
  
-               return self::magicLinkbyContact($contact, $url);
+               return self::magicLinkByContact($contact, $url);
        }
  
        /**
         * @throws \Friendica\Network\HTTPException\InternalServerErrorException
         * @throws \ImagickException
         */
-       public static function magicLinkbyContact($contact, $url = '')
+       public static function magicLinkByContact($contact, $url = '')
        {
                if ((!local_user() && !remote_user()) || ($contact['network'] != Protocol::DFRN)) {
                        return $url ?: $contact['url']; // Equivalent to ($url != '') ? $url : $contact['url'];
  
                return $redirect;
        }
 +
 +      public static function removeFromGroups($contact_id)
 +      {
 +              return DBA::delete('group_member', ['contact-id' => $contact_id]);
 +      }
  }