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

14 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/fetch.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..00d11add52be143c8e93080e5c96062a2dffed9e
@@@ -2089,16 -2160,16 +2160,19 @@@ class Diaspora 
                $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;
        }
                        dbesc($target_guid),
                        intval($importer["uid"])
                );
--              if (!$r)
++              if (!$r) {
                        return false;
++              }
  
                // Check if the sender is the thread owner
                $p = q("SELECT `id`, `author-link`, `origin` FROM `item` WHERE `id` = %d",
                logger("Deleted target ".$target_guid." (".$r[0]["id"].") from user ".$importer["uid"]." parent: ".$p[0]["id"], LOGGER_DEBUG);
  
                // Now check if the retraction needs to be relayed by us
--              if($p[0]["origin"]) {
++              if ($p[0]["origin"]) {
                        // notify others
                        proc_run(PRIORITY_HIGH, "include/notifier.php", "drop", $r[0]["id"]);
                }
         * @return string the handle in the format user@domain.tld
         */
        private function my_handle($contact) {
--              if ($contact["addr"] != "")
++              if ($contact["addr"] != "") {
                        return $contact["addr"];
++              }
  
                // Normally we should have a filled "addr" field - but in the past this wasn't the case
                // So - just in case - we build the the address here.
--              if ($contact["nickname"] != "")
++              if ($contact["nickname"] != "") {
                        $nick = $contact["nickname"];
--              else
++              } else {
                        $nick = $contact["nick"];
++              }
  
                return $nick."@".substr(App::get_baseurl(), strpos(App::get_baseurl(),"://") + 3);
        }
Simple merge
Simple merge
Simple merge
Simple merge
index 22d4c1535872e7388f99cce209118b4917d910aa,e30617663019b47503a8d3bf038aebb14b6409c6..34c1213c3fae7719840b710c603d315fc7eee055
@@@ -425,18 -423,17 +425,18 @@@ function dfrn_confirm_post(&$a,$handsfr
                $r = q("SELECT * FROM `contact` WHERE `id` = %d LIMIT 1",
                        intval($contact_id)
                );
 -              if (dbm::is_result($r))
 +              if (dbm::is_result($r)) {
                        $contact = $r[0];
 -              else
 +              } else {
                        $contact = null;
 +              }
  
  
 -              if((isset($new_relation) && $new_relation == CONTACT_IS_FRIEND)) {
 +              if ((isset($new_relation) && $new_relation == CONTACT_IS_FRIEND)) {
  
 -                      if(($contact) && ($contact['network'] === NETWORK_DIASPORA)) {
 +                      if (($contact) && ($contact['network'] === NETWORK_DIASPORA)) {
                                require_once('include/diaspora.php');
-                               $ret = diaspora::send_share($user[0],$r[0]);
+                               $ret = Diaspora::send_share($user[0],$r[0]);
                                logger('share returns: ' . $ret);
                        }
  
diff --cc mod/fetch.php
Simple merge
diff --cc mod/item.php
Simple merge
diff --cc mod/receive.php
Simple merge
diff --cc object/Item.php
index e60344f7d331558aa12b66d3c0d19dd20936b1f9,41821e538804d87a253560a609883eaf05c94bd4..85750c4f5296965391206053feaed4ec376cc4ca
@@@ -38,9 -38,9 +38,9 @@@ class Item extends BaseObject 
                $this->set_template('wall');
                $this->toplevel = ($this->get_id() == $this->get_data_value('parent'));
  
--              if(is_array($_SESSION['remote'])) {
--                      foreach($_SESSION['remote'] as $visitor) {
--                              if($visitor['cid'] == $this->get_data_value('contact-id')) {
++              if (is_array($_SESSION['remote'])) {
++                      foreach ($_SESSION['remote'] as $visitor) {
++                              if ($visitor['cid'] == $this->get_data_value('contact-id')) {
                                        $this->visiting = true;
                                        break;
                                }
  
                // 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);