From: Hypolite Petovan Date: Sun, 5 Aug 2018 10:34:33 +0000 (+0200) Subject: Add conversation storage for Twitter X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=c4e69b77660f221b30a5b39f8d3624ef35595ca3;p=friendica.git Add conversation storage for Twitter --- diff --git a/src/Model/Conversation.php b/src/Model/Conversation.php index d6e222a81b..cde81090e4 100644 --- a/src/Model/Conversation.php +++ b/src/Model/Conversation.php @@ -2,6 +2,7 @@ /** * @file src/Model/Conversation */ + namespace Friendica\Model; use Friendica\Database\DBA; @@ -29,8 +30,10 @@ class Conversation * @param array $arr Item array with conversation data * @return array Item array with removed conversation data */ - public static function insert($arr) { - if (in_array(defaults($arr, 'network', NETWORK_PHANTOM), [NETWORK_DFRN, NETWORK_DIASPORA, NETWORK_OSTATUS]) && !empty($arr['uri'])) { + public static function insert(array $arr) + { + if (in_array(defaults($arr, 'network', NETWORK_PHANTOM), + [NETWORK_DFRN, NETWORK_DIASPORA, NETWORK_OSTATUS, NETWORK_TWITTER]) && !empty($arr['uri'])) { $conversation = ['item-uri' => $arr['uri'], 'received' => DateTimeFormat::utcNow()]; if (isset($arr['parent-uri']) && ($arr['parent-uri'] != $arr['uri'])) { @@ -70,11 +73,13 @@ class Conversation unset($conversation['source']); } if (!DBA::update('conversation', $conversation, ['item-uri' => $conversation['item-uri']], $old_conv)) { - logger('Conversation: update for '.$conversation['item-uri'].' from '.$old_conv['protocol'].' to '.$conversation['protocol'].' failed', LOGGER_DEBUG); + logger('Conversation: update for ' . $conversation['item-uri'] . ' from ' . $old_conv['protocol'] . ' to ' . $conversation['protocol'] . ' failed', + LOGGER_DEBUG); } } else { if (!DBA::insert('conversation', $conversation, true)) { - logger('Conversation: insert for '.$conversation['item-uri'].' (protocol '.$conversation['protocol'].') failed', LOGGER_DEBUG); + logger('Conversation: insert for ' . $conversation['item-uri'] . ' (protocol ' . $conversation['protocol'] . ') failed', + LOGGER_DEBUG); } } }