]> git.mxchange.org Git - friendica.git/blobdiff - include/items.php
fix twitter title showing up occasionally
[friendica.git] / include / items.php
index 5e3f9a60a207a7b1a5662d255d2d606b8e059d2c..f87a92334c1776f22aa67f92853406e494c2be43 100755 (executable)
@@ -977,6 +977,7 @@ function tag_deliver($uid,$item_id) {
                'language'     => $u[0]['language'],
                'to_name'      => $u[0]['username'],
                'to_email'     => $u[0]['email'],
+               'uid'          => $u[0]['uid'],
                'item'         => $item,
                'link'         => $a->get_baseurl() . '/display/' . $u[0]['nickname'] . '/' . $item['id'],
                'source_name'  => $item['author-name'],
@@ -999,7 +1000,16 @@ function tag_deliver($uid,$item_id) {
        // now change this copy of the post to a forum head message and deliver to all the tgroup members
 
 
-       q("update item set wall = 1, origin = 1, forum_mode = 1 where id = %d limit 1",
+       $c = q("select name, url, thumb from contact where self = 1 and uid = %d limit 1",
+               intval($u[0]['uid'])
+       );
+       if(! count($c))
+               return;
+
+       q("update item set wall = 1, origin = 1, forum_mode = 1, `owner-name` = '%s', `owner-link` = '%s', `owner-avatar` = '%s'  where id = %d limit 1",
+               dbesc($c[0]['name']),
+               dbesc($c[0]['url']),
+               dbesc($c[0]['thumb']),
                intval($item_id)
        );
 
@@ -1016,8 +1026,8 @@ function dfrn_deliver($owner,$contact,$atom, $dissolve = false) {
 
        $a = get_app();
 
-       if((! strlen($contact['issued-id'])) && (! $contact['duplex']) && (! ($owner['page-flags'] == PAGE_COMMUNITY)))
-               return 3;
+//     if((! strlen($contact['issued-id'])) && (! $contact['duplex']) && (! ($owner['page-flags'] == PAGE_COMMUNITY)))
+//             return 3;
 
        $idtosend = $orig_id = (($contact['dfrn-id']) ? $contact['dfrn-id'] : $contact['issued-id']);
 
@@ -1068,7 +1078,9 @@ function dfrn_deliver($owner,$contact,$atom, $dissolve = false) {
        $final_dfrn_id = '';
 
 
-       if(($contact['duplex'] && strlen($contact['pubkey'])) || ($owner['page-flags'] == PAGE_COMMUNITY && strlen($contact['pubkey']))) {
+       if(($contact['duplex'] && strlen($contact['pubkey'])) 
+               || ($owner['page-flags'] == PAGE_COMMUNITY && strlen($contact['pubkey']))
+               || ($contact['rel'] == CONTACT_IS_SHARING && strlen($contact['pubkey']))) {
                openssl_public_decrypt($sent_dfrn_id,$final_dfrn_id,$contact['pubkey']);
                openssl_public_decrypt($challenge,$postvars['challenge'],$contact['pubkey']);
        }
@@ -1111,7 +1123,10 @@ function dfrn_deliver($owner,$contact,$atom, $dissolve = false) {
 
 
                if($dfrn_version >= 2.1) {      
-                       if(($contact['duplex'] && strlen($contact['pubkey'])) || ($owner['page-flags'] == PAGE_COMMUNITY && strlen($contact['pubkey']))) {
+                       if(($contact['duplex'] && strlen($contact['pubkey'])) 
+                               || ($owner['page-flags'] == PAGE_COMMUNITY && strlen($contact['pubkey']))
+                               || ($contact['rel'] == CONTACT_IS_SHARING && strlen($contact['pubkey']))) {
+
                                openssl_public_encrypt($key,$postvars['key'],$contact['pubkey']);
                        }
                        else {
@@ -1685,7 +1700,7 @@ function consume_feed($xml,$importer,&$contact, &$hub, $datedir = 0, $pass = 0)
                                if(! is_array($contact))
                                        return;
 
-                               if($contact['network'] === NETWORK_OSTATUS || stristr($permalink,'twitter.com')) {
+                               if($contact['network'] === NETWORK_OSTATUS || stristr($contact['url'],'twitter.com')) {
                                        if(strlen($datarray['title']))
                                                unset($datarray['title']);
                                        $datarray['last-child'] = 1;
@@ -1834,6 +1849,7 @@ function local_delivery($importer,$data) {
                        'language'     => $importer['language'],
                        'to_name'      => $importer['username'],
                        'to_email'     => $importer['email'],
+                       'uid'          => $importer['importer_uid'],
                        'item'         => $fsugg,
                        'link'         => $a->get_baseurl() . '/notifications/intros',
                        'source_name'  => $importer['name'],
@@ -1885,6 +1901,7 @@ function local_delivery($importer,$data) {
                        'language' => $importer['language'],
                        'to_name' => $importer['username'],
                        'to_email' => $importer['email'],
+                       'uid' => $importer['importer_uid'],
                        'item' => $msg,
                        'source_name' => $msg['from-name'],
                        'source_link' => $importer['url'],
@@ -2057,7 +2074,7 @@ function local_delivery($importer,$data) {
                                $datarray = get_atom_elements($feed,$item);
 
 
-               // TODO: make this next part work against both delivery threads of a community post
+                               // TODO: make this next part work against both delivery threads of a community post
 
 //                             if((! link_compare($datarray['author-link'],$importer['url'])) && (! $community)) {
 //                                     logger('local_delivery: received relay claiming to be from ' . $importer['url'] . ' however comment author url is ' . $datarray['author-link'] ); 
@@ -2157,6 +2174,7 @@ function local_delivery($importer,$data) {
                                                                'language'     => $importer['language'],
                                                                'to_name'      => $importer['username'],
                                                                'to_email'     => $importer['email'],
+                                                               'uid'          => $importer['importer_uid'],
                                                                'item'         => $datarray,
                                                                'link'             => $a->get_baseurl() . '/display/' . $importer['nickname'] . '/' . $posted_id,
                                                                'source_name'  => stripslashes($datarray['author-name']),
@@ -2277,6 +2295,7 @@ function local_delivery($importer,$data) {
                                                                'language'     => $importer['language'],
                                                                'to_name'      => $importer['username'],
                                                                'to_email'     => $importer['email'],
+                                                               'uid'          => $importer['importer_uid'],
                                                                'item'         => $datarray,
                                                                'link'             => $a->get_baseurl() . '/display/' . $importer['nickname'] . '/' . $posted_id,
                                                                'source_name'  => stripslashes($datarray['author-name']),