]> git.mxchange.org Git - friendica.git/blobdiff - src/Model/Tag.php
Merge pull request #13230 from annando/warnings
[friendica.git] / src / Model / Tag.php
index 0e891f9c6f27870e314aa75a7b8e74329f3e94ff..1645dc1255b540a9f66742b3c987f6a7bd93e78b 100644 (file)
@@ -50,14 +50,16 @@ class Tag
         */
        const IMPLICIT_MENTION  = 8;
        /**
-        * An exclusive mention transmits the post only to the target account without transmitting it to the followers, usually a forum.
+        * An exclusive mention transmits the post only to the target account without transmitting it to the followers, usually a group.
         */
        const EXCLUSIVE_MENTION = 9;
 
-       const TO  = 10;
-       const CC  = 11;
-       const BTO = 12;
-       const BCC = 13;
+       const TO         = 10;
+       const CC         = 11;
+       const BTO        = 12;
+       const BCC        = 13;
+       const AUDIENCE   = 14;
+       const ATTRIBUTED = 15;
 
        const ACCOUNT             = 1;
        const GENERAL_COLLECTION  = 2;
@@ -103,7 +105,7 @@ class Tag
                $cid = 0;
                $tagid = 0;
 
-               if (in_array($type, [self::MENTION, self::EXCLUSIVE_MENTION, self::IMPLICIT_MENTION, self::TO, self::CC, self::BTO, self::BCC])) {
+               if (in_array($type, [self::MENTION, self::EXCLUSIVE_MENTION, self::IMPLICIT_MENTION, self::TO, self::CC, self::BTO, self::BCC, self::AUDIENCE, self::ATTRIBUTED])) {
                        if (empty($url)) {
                                // No mention without a contact url
                                return;
@@ -130,7 +132,7 @@ class Tag
                }
 
                if (empty($cid)) {
-                       if (!in_array($type, [self::TO, self::CC, self::BTO, self::BCC])) {
+                       if (!in_array($type, [self::TO, self::CC, self::BTO, self::BCC, self::AUDIENCE, self::ATTRIBUTED])) {
                                if (($type != self::HASHTAG) && !empty($url) && ($url != $name)) {
                                        $url = strtolower($url);
                                } else {
@@ -485,7 +487,7 @@ class Tag
         *
         * @return boolean
         */
-       public static function isMentioned(int $uriId, string $url, array $type = [self::MENTION, self::EXCLUSIVE_MENTION]): bool
+       public static function isMentioned(int $uriId, string $url, array $type = [self::MENTION, self::EXCLUSIVE_MENTION, self::AUDIENCE]): bool
        {
                $tags = self::getByURIId($uriId, $type);
                foreach ($tags as $tag) {