]> git.mxchange.org Git - friendica.git/blobdiff - src/Model/Conversation.php
Merge pull request #9411 from tobiasd/20201011-de
[friendica.git] / src / Model / Conversation.php
index 661cfcd6af3770ee1dc6f2fb756b3879af577f97..1dcb6b0c2d7cc8476d1a0038eb613579d092a487 100644 (file)
@@ -41,6 +41,19 @@ class Conversation
        const PARCEL_TWITTER            = 67;
        const PARCEL_UNKNOWN            = 255;
 
+       /**
+        * Unknown message direction
+        */
+       const UNKNOWN = 0;
+       /**
+        * The message had been pushed to this sytem
+        */
+       const PUSH    = 1;
+       /**
+        * The message had been fetched by our system
+        */
+       const PULL    = 2;
+
        public static function getByItemUri($item_uri)
        {
                return DBA::selectFirst('conversation', [], ['item-uri' => $item_uri]);
@@ -79,6 +92,10 @@ class Conversation
                                $conversation['protocol'] = $arr['protocol'];
                        }
 
+                       if (isset($arr['direction'])) {
+                               $conversation['direction'] = $arr['direction'];
+                       }
+
                        if (isset($arr['source'])) {
                                $conversation['source'] = $arr['source'];
                        }
@@ -118,6 +135,7 @@ class Conversation
                unset($arr['conversation-href']);
                unset($arr['protocol']);
                unset($arr['source']);
+               unset($arr['direction']);
 
                return $arr;
        }