]> git.mxchange.org Git - friendica.git/commitdiff
Merge branch 'master', remote-tracking branch 'remotes/upstream/master'
authorSimon L'nu <simon.lnu@gmail.com>
Wed, 29 Feb 2012 11:56:59 +0000 (06:56 -0500)
committerSimon L'nu <simon.lnu@gmail.com>
Wed, 29 Feb 2012 11:56:59 +0000 (06:56 -0500)
* remotes/upstream/master:
  Update LICENSE
  Update README
  cleaned up mess created when both people request friendship and one approves as duplex
  call time pass by reference deprecated
  From Tobias H - catch some irregularities caused by cut/paste code

* master:

LICENSE
README
boot.php
include/html2bbcode.php
include/items.php
mod/dfrn_confirm.php
mod/display.php
mod/network.php

diff --git a/LICENSE b/LICENSE
index 65ec68b9c2c7a35cf2a84eb7de557f19943213a7..15c3e825b6f34735a6f11f2ffda566be93eb8c13 100755 (executable)
--- a/LICENSE
+++ b/LICENSE
@@ -1,4 +1,4 @@
-Copyright (c) 2010, 2011 the Friendica Project
+Copyright (c) 2010-2012 the Friendica Project
 All rights reserved.
 
 Permission is hereby granted, free of charge, to any person obtaining a copy
diff --git a/README b/README
index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..152d481eac1eb80895c1954956e697238705de6c 100644 (file)
--- a/README
+++ b/README
@@ -0,0 +1,4 @@
+Friendica Social Communications Server
+======================================
+
+Welcome to the free social web.
index c3e5c0de02214d27e4948c5927f747948a16e291..e1dc7e5373115177076add5c1d697a3af7df53c0 100755 (executable)
--- a/boot.php
+++ b/boot.php
@@ -9,7 +9,7 @@ require_once('include/nav.php');
 require_once('include/cache.php');
 
 define ( 'FRIENDICA_PLATFORM',     'Friendica');
-define ( 'FRIENDICA_VERSION',      '2.3.1265' );
+define ( 'FRIENDICA_VERSION',      '2.3.1266' );
 define ( 'DFRN_PROTOCOL_VERSION',  '2.22'    );
 define ( 'DB_UPDATE_VERSION',      1129      );
 
index 65920380b5d4c8ef2b63ef4e3e9f6cf197242de1..51d62994073d839592d525e56744440ae8a249c2 100755 (executable)
@@ -10,7 +10,7 @@ Originally made for the syncom project: http://wiki.piratenpartei.de/Syncom
 function node2bbcode(&$doc, $oldnode, $attributes, $startbb, $endbb)
 {
        do {
-               $done = node2bbcodesub(&$doc, $oldnode, $attributes, $startbb, $endbb);
+               $done = node2bbcodesub($doc, $oldnode, $attributes, $startbb, $endbb);
        } while ($done);
 }
 
index 7d52571c25d6a176d32a0b70540df807102ac2ed..250d023cec1b2687a630dda4d0da7815b34b89fc 100755 (executable)
@@ -2424,7 +2424,7 @@ function local_delivery($importer,$data) {
                        // This is my contact on another system, but it's really me.
                        // Turn this into a wall post.
 
-                       if($contact['remote_self'])
+                       if($importer['remote_self'])
                                $datarray['wall'] = 1;
 
                        $datarray['parent-uri'] = $item_id;
index 5a24f00893b493e34ea1fff755375b6126bf3622..0bc3ea7df597550f96286b8210fc6925da788876 100644 (file)
@@ -107,7 +107,7 @@ function dfrn_confirm_post(&$a,$handsfree = null) {
                 *
                 */
 
-               $r = q("SELECT * FROM `contact` WHERE ( ( `issued-id` != '' AND `issued-id` = '%s' ) OR ( `id` = %d AND `id` != 0 ) ) AND `uid` = %d LIMIT 1",
+               $r = q("SELECT * FROM `contact` WHERE ( ( `issued-id` != '' AND `issued-id` = '%s' ) OR ( `id` = %d AND `id` != 0 ) ) AND `uid` = %d AND `duplex` = 0 LIMIT 1",
                        dbesc($dfrn_id),
                        intval($cid),
                        intval($uid)
@@ -116,6 +116,7 @@ function dfrn_confirm_post(&$a,$handsfree = null) {
                if(! count($r)) {
                        logger('dfrn_confirm: Contact not found in DB.'); 
                        notice( t('Contact not found.') . EOL );
+                       notice( t('This may occasionally happen if contact was requested by both persons and it has already been approved.') . EOL );
                        return;
                }
 
@@ -631,6 +632,15 @@ function dfrn_confirm_post(&$a,$handsfree = null) {
                        xml_status(3,$message);
                }
 
+               // It's possible that the other person also requested friendship.
+               // If it is a duplex relationship, ditch the issued-id if one exists. 
+
+               if($duplex) {
+                       $r = q("UPDATE `contact` SET `issued-id` = '' WHERE `id` = %d LIMIT 1",
+                               intval($dfrn_record)
+                       );
+               }
+
                // We're good but now we have to scrape the profile photo and send notifications.
 
 
index d96be4333bebc2ac4af56d47da159c07bf29e967..f510f793df9d98b2e05356ab6c0b387da0b5a515 100755 (executable)
@@ -74,11 +74,11 @@ function display_content(&$a) {
                $x = array(
                        'is_owner' => true,
                        'allow_location' => $a->user['allow_location'],
-                       'default_location' => $a->user['default_location'],
+                       'default_location' => $a->user['default-location'],
                        'nickname' => $a->user['nickname'],
-                       'lockstate' => ((($group) || (is_array($a->user) && ((strlen($a->user['allow_cid'])) || (strlen($a->user['allow_gid'])) || (strlen($a->user['deny_cid'])) || (strlen($a->user['deny_gid']))))) ? 'lock' : 'unlock'),
-                       'acl' => populate_acl((($group || $cid) ? $def_acl : $a->user), $celeb),
-                       'bang' => (($group || $cid) ? '!' : ''),
+                       'lockstate' => ( (is_array($a->user)) && ((strlen($a->user['allow_cid'])) || (strlen($a->user['allow_gid'])) || (strlen($a->user['deny_cid'])) || (strlen($a->user['deny_gid']))) ? 'lock' : 'unlock'),
+                       'acl' => populate_acl($a->user, $celeb),
+                       'bang' => '',
                        'visitor' => 'block',
                        'profile_uid' => local_user()
                );      
index 03a671b6157d51dc7939dfbfa024eb6ca9bf7fe2..894ac48ed67e3554d7265841b27f5a34b7540ad5 100755 (executable)
@@ -263,7 +263,7 @@ function network_content(&$a, $update = 0) {
                $x = array(
                        'is_owner' => true,
                        'allow_location' => $a->user['allow_location'],
-                       'default_location' => $a->user['default_location'],
+                       'default_location' => $a->user['default-location'],
                        'nickname' => $a->user['nickname'],
                        'lockstate' => ((($group) || (is_array($a->user) && ((strlen($a->user['allow_cid'])) || (strlen($a->user['allow_gid'])) || (strlen($a->user['deny_cid'])) || (strlen($a->user['deny_gid']))))) ? 'lock' : 'unlock'),
                        'acl' => populate_acl((($group || $cid) ? $def_acl : $a->user), $celeb),