]> git.mxchange.org Git - friendica.git/commitdiff
Merge remote-tracking branch 'upstream/develop' into rewrites/app_get_baseurl_static
authorRoland Häder <roland@mxchange.org>
Thu, 22 Dec 2016 10:33:00 +0000 (11:33 +0100)
committerRoland Häder <roland@mxchange.org>
Thu, 22 Dec 2016 10:33:00 +0000 (11:33 +0100)
Signed-off-by: Roland Häder <roland@mxchange.org>
Conflicts:
include/diaspora.php
object/Item.php

13 files changed:
1  2 
include/Contact.php
include/api.php
include/contact_selectors.php
include/delivery.php
include/diaspora.php
include/follow.php
include/like.php
include/notifier.php
include/queue.php
mod/dfrn_confirm.php
mod/item.php
mod/receive.php
object/Item.php

Simple merge
diff --cc include/api.php
Simple merge
Simple merge
Simple merge
index cfb624fdf2a075a62803649aa982658ec85f4f19,2547de5149b9354eb6b522831cdf2710702f35cd..e4c81dca49aae0ca6aaaec8a348ba75268d33a88
@@@ -1840,20 -1906,20 +1906,23 @@@ class Diaspora 
                $author = unxmlify($data->author);
                $recipient = unxmlify($data->recipient);
  
--              if (!$author || !$recipient)
++              if (!$author || !$recipient) {
                        return false;
++              }
  
                // the current protocol version doesn't know these fields
                // That means that we will assume their existance
--              if (isset($data->following))
++              if (isset($data->following)) {
                        $following = (unxmlify($data->following) == "true");
--              else
++              } else {
                        $following = true;
++              }
  
--              if (isset($data->sharing))
++              if (isset($data->sharing)) {
                        $sharing = (unxmlify($data->sharing) == "true");
--              else
++              } else {
                        $sharing = true;
++              }
  
                $contact = self::contact_by_handle($importer["uid"],$author);
  
                                // Normally we needn't to do so, but the first message could have been vanished.
                                if (in_array($contact["rel"], array(CONTACT_IS_FRIEND, CONTACT_IS_FOLLOWER))) {
                                        $u = q("SELECT * FROM `user` WHERE `uid` = %d LIMIT 1", intval($importer["uid"]));
--                                      if($u) {
++                                      if ($u) {
                                                logger("Sending share message to author ".$author." - Contact: ".$contact["id"]." - User: ".$importer["uid"], LOGGER_DEBUG);
                                                $ret = self::send_share($u[0], $contact);
                                        }
                $created_at = datetime_convert("UTC", "UTC", notags(unxmlify($data->created_at)));
  
                $contact = self::allowed_contact_by_handle($importer, $author, false);
--              if (!$contact)
++              if (!$contact) {
                        return false;
++              }
  
                $message_id = self::message_exists($importer["uid"], $guid);
--              if ($message_id)
++              if ($message_id) {
                        return $message_id;
++              }
  
                $original_item = self::original_item($root_guid, $root_author, $author);
--              if (!$original_item)
++              if (!$original_item) {
                        return false;
++              }
  
                $orig_url = App::get_baseurl()."/display/".$original_item["guid"];
  
                self::fetch_guid($datarray);
                $message_id = item_store($datarray);
  
--              if ($message_id)
++              if ($message_id) {
                        logger("Stored reshare ".$datarray["guid"]." with message id ".$message_id, LOGGER_DEBUG);
++              }
  
                return $message_id;
        }
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
diff --cc mod/item.php
Simple merge
diff --cc mod/receive.php
Simple merge
diff --cc object/Item.php
index e60344f7d331558aa12b66d3c0d19dd20936b1f9,41821e538804d87a253560a609883eaf05c94bd4..1c6eaf5f940cca401a28c3dea85960948d015221
@@@ -349,83 -334,81 +349,83 @@@ class Item extends BaseObject 
  
                // Diaspora isn't able to do likes on comments - but red does
                if (($item["item_network"] == NETWORK_DIASPORA) AND ($indent == 'comment') AND
-                       !diaspora::is_redmatrix($item["owner-link"]) AND isset($buttons["like"])) {
 -                      !Diaspora::is_redmatrix($item["owner-link"]) AND isset($buttons["like"]))
++                      !Diaspora::is_redmatrix($item["owner-link"]) AND isset($buttons["like"])) {
                        unset($buttons["like"]);
 +              }
  
                // Diaspora doesn't has multithreaded comments
 -              if (($item["item_network"] == NETWORK_DIASPORA) AND ($indent == 'comment'))
 +              if (($item["item_network"] == NETWORK_DIASPORA) AND ($indent == 'comment')) {
                        unset($comment);
 +              }
  
                // Facebook can like comments - but it isn't programmed in the connector yet.
 -              if (($item["item_network"] == NETWORK_FACEBOOK) AND ($indent == 'comment') AND isset($buttons["like"]))
 +              if (($item["item_network"] == NETWORK_FACEBOOK) AND ($indent == 'comment') AND isset($buttons["like"])) {
                        unset($buttons["like"]);
 +              }
  
                $tmp_item = array(
 -                      'template' => $this->get_template(),
 -
 -                      'type' => implode("",array_slice(explode("/",$item['verb']),-1)),
 -                      'tags' => $item['tags'],
 -                      'hashtags' => $item['hashtags'],
 -                      'mentions' => $item['mentions'],
 -                      'txt_cats' => t('Categories:'),
 -                      'txt_folders' => t('Filed under:'),
 -                      'has_cats' => ((count($categories)) ? 'true' : ''),
 -                      'has_folders' => ((count($folders)) ? 'true' : ''),
 -                      'categories' => $categories,
 -                      'folders' => $folders,
 -                      'body' => $body_e,
 -                      'text' => $text_e,
 -                      'id' => $this->get_id(),
 -                      'guid' => urlencode($item['guid']),
 -                      'isevent' => $isevent,
 -                      'attend' => $attend,
 -                      'linktitle' => sprintf( t('View %s\'s profile @ %s'), $profile_name, ((strlen($item['author-link'])) ? $item['author-link'] : $item['url'])),
 -                      'olinktitle' => sprintf( t('View %s\'s profile @ %s'), htmlentities($this->get_owner_name()), ((strlen($item['owner-link'])) ? $item['owner-link'] : $item['url'])),
 -                      'to' => t('to'),
 -                      'via' => t('via'),
 -                      'wall' => t('Wall-to-Wall'),
 -                      'vwall' => t('via Wall-To-Wall:'),
 -                      'profile_url' => $profile_link,
 +                      'template'        => $this->get_template(),
 +                      'type'            => implode("",array_slice(explode("/",$item['verb']),-1)),
 +                      'tags'            => $item['tags'],
 +                      'hashtags'        => $item['hashtags'],
 +                      'mentions'        => $item['mentions'],
 +                      'txt_cats'        => t('Categories:'),
 +                      'txt_folders'     => t('Filed under:'),
 +                      'has_cats'        => ((count($categories)) ? 'true' : ''),
 +                      'has_folders'     => ((count($folders)) ? 'true' : ''),
 +                      'categories'      => $categories,
 +                      'folders'         => $folders,
 +                      'body'            => $body_e,
 +                      'text'            => $text_e,
 +                      'id'              => $this->get_id(),
 +                      'guid'            => urlencode($item['guid']),
 +                      'isevent'         => $isevent,
 +                      'attend'          => $attend,
 +                      'linktitle'       => sprintf( t('View %s\'s profile @ %s'), $profile_name, ((strlen($item['author-link'])) ? $item['author-link'] : $item['url'])),
 +                      'olinktitle'      => sprintf( t('View %s\'s profile @ %s'), htmlentities($this->get_owner_name()), ((strlen($item['owner-link'])) ? $item['owner-link'] : $item['url'])),
 +                      'to'              => t('to'),
 +                      'via'             => t('via'),
 +                      'wall'            => t('Wall-to-Wall'),
 +                      'vwall'           => t('via Wall-To-Wall:'),
 +                      'profile_url'     => $profile_link,
                        'item_photo_menu' => item_photo_menu($item),
 -                      'name' => $name_e,
 -                      'thumb' => $a->remove_baseurl(proxy_url($item['author-thumb'], false, PROXY_SIZE_THUMB)),
 -                      'osparkle' => $osparkle,
 -                      'sparkle' => $sparkle,
 -                      'title' => $title_e,
 -                      'localtime' => datetime_convert('UTC', date_default_timezone_get(), $item['created'], 'r'),
 -                      'ago' => (($item['app']) ? sprintf( t('%s from %s'),relative_date($item['created']),$item['app']) : relative_date($item['created'])),
 -                      'app' => $item['app'],
 -                      'created' => relative_date($item['created']),
 -                      'lock' => $lock,
 -                      'location' => $location_e,
 -                      'indent' => $indent,
 -                      'shiny' => $shiny,
 -                      'owner_url' => $this->get_owner_url(),
 -                      'owner_photo' => $a->remove_baseurl(proxy_url($item['owner-thumb'], false, PROXY_SIZE_THUMB)),
 -                      'owner_name' => htmlentities($owner_name_e),
 -                      'plink' => get_plink($item),
 -                      'edpost'    => ((feature_enabled($conv->get_profile_owner(),'edit_posts')) ? $edpost : ''),
 -                      'isstarred' => $isstarred,
 -                      'star'      => ((feature_enabled($conv->get_profile_owner(),'star_posts')) ? $star : ''),
 -                      'ignore'      => ((feature_enabled($conv->get_profile_owner(),'ignore_posts')) ? $ignore : ''),
 -                      'tagger'        => $tagger,
 -                      'filer'     => ((feature_enabled($conv->get_profile_owner(),'filing')) ? $filer : ''),
 -                      'drop' => $drop,
 -                      'vote' => $buttons,
 -                      'like' => $responses['like']['output'],
 -                      'dislike'   => $responses['dislike']['output'],
 -                      'responses' => $responses,
 -                      'switchcomment' => t('Comment'),
 -                      'comment' => $comment,
 -                      'previewing' => ($conv->is_preview() ? ' preview ' : ''),
 -                      'wait' => t('Please wait'),
 -                      'thread_level' => $thread_level,
 -                      'postopts' => $langstr,
 -                      'edited' => $edited,
 -                      'network' => $item["item_network"],
 -                      'network_name' => network_to_name($item['item_network'], $profile_link),
 +                      'name'            => $name_e,
 +                      'thumb'           => $a->remove_baseurl(proxy_url($item['author-thumb'], false, PROXY_SIZE_THUMB)),
 +                      'osparkle'        => $osparkle,
 +                      'sparkle'         => $sparkle,
 +                      'title'           => $title_e,
 +                      'localtime'       => datetime_convert('UTC', date_default_timezone_get(), $item['created'], 'r'),
 +                      'ago'             => (($item['app']) ? sprintf( t('%s from %s'),relative_date($item['created']),$item['app']) : relative_date($item['created'])),
 +                      'app'             => $item['app'],
 +                      'created'         => relative_date($item['created']),
 +                      'lock'            => $lock,
 +                      'location'        => $location_e,
 +                      'indent'          => $indent,
 +                      'shiny'           => $shiny,
 +                      'owner_url'       => $this->get_owner_url(),
 +                      'owner_photo'     => $a->remove_baseurl(proxy_url($item['owner-thumb'], false, PROXY_SIZE_THUMB)),
 +                      'owner_name'      => htmlentities($owner_name_e),
 +                      'plink'           => get_plink($item),
 +                      'edpost'          => ((feature_enabled($conv->get_profile_owner(),'edit_posts')) ? $edpost : ''),
 +                      'isstarred'       => $isstarred,
 +                      'star'            => ((feature_enabled($conv->get_profile_owner(),'star_posts')) ? $star : ''),
 +                      'ignore'          => ((feature_enabled($conv->get_profile_owner(),'ignore_posts')) ? $ignore : ''),
 +                      'tagger'          => $tagger,
 +                      'filer'           => ((feature_enabled($conv->get_profile_owner(),'filing')) ? $filer : ''),
 +                      'drop'            => $drop,
 +                      'vote'            => $buttons,
 +                      'like'            => $responses['like']['output'],
 +                      'dislike'         => $responses['dislike']['output'],
 +                      'responses'       => $responses,
 +                      'switchcomment'   => t('Comment'),
 +                      'comment'         => $comment,
 +                      'previewing'      => ($conv->is_preview() ? ' preview ' : ''),
 +                      'wait'            => t('Please wait'),
 +                      'thread_level'    => $thread_level,
 +                      'postopts'        => $langstr,
 +                      'edited'          => $edited,
 +                      'network'         => $item["item_network"],
 +                      'network_name'    => network_to_name($item['item_network'], $profile_link),
                );
  
                $arr = array('item' => $item, 'output' => $tmp_item);