aboutsummaryrefslogtreecommitdiffstats
path: root/mod
diff options
context:
space:
mode:
Diffstat (limited to 'mod')
-rw-r--r--mod/connedit.php25
-rw-r--r--mod/import.php16
-rw-r--r--mod/item.php1
3 files changed, 31 insertions, 11 deletions
diff --git a/mod/connedit.php b/mod/connedit.php
index 877c12dc7..9c46fa999 100644
--- a/mod/connedit.php
+++ b/mod/connedit.php
@@ -177,16 +177,21 @@ function connedit_post(&$a) {
if(($_REQUEST['pending']) && intval($orig_record[0]['abook_pending'])) {
$new_friend = true;
- if(! $abook_my_perms) {
- $abook_my_perms = get_channel_default_perms(local_channel());
+ // @fixme it won't be common, but when you accept a new connection request
+ // the permissions will now be that of your permissions role and ignore
+ // any you may have set manually on the form. We'll probably see a bug if somebody
+ // tries to set the permissions *and* approve the connection in the same
+ // request. The workaround is to approve the connection, then go back and
+ // adjust permissions as desired.
- $role = get_pconfig(local_channel(),'system','permissions_role');
- if($role) {
- $x = get_role_perms($role);
- if($x['perms_accept'])
- $abook_my_perms = $x['perms_accept'];
- }
+ $abook_my_perms = get_channel_default_perms(local_channel());
+
+ $role = get_pconfig(local_channel(),'system','permissions_role');
+ if($role) {
+ $x = get_role_perms($role);
+ if($x['perms_accept'])
+ $abook_my_perms = $x['perms_accept'];
}
}
@@ -661,6 +666,10 @@ function connedit_content(&$a) {
if($locs) {
foreach($locs as $l) {
+ if(!($l['location']))
+ continue;
+ if(strpos($locstr,$l['location']) !== false)
+ continue;
if(strlen($locstr))
$locstr .= ', ';
$locstr .= $l['location'];
diff --git a/mod/import.php b/mod/import.php
index 72d8f92e9..a33cf339b 100644
--- a/mod/import.php
+++ b/mod/import.php
@@ -9,11 +9,12 @@ require_once('include/identity.php');
require_once('include/import.php');
-function import_post(&$a) {
+function import_account(&$a, $account_id) {
- $account_id = get_account_id();
- if(! $account_id)
+ if(! $account_id){
+ logger("import_account: No account ID supplied");
return;
+ }
$max_identities = account_service_class_fetch($account_id,'total_identities');
$max_friends = account_service_class_fetch($account_id,'total_channels');
@@ -493,6 +494,15 @@ function import_post(&$a) {
}
+function import_post(&$a) {
+
+ $account_id = get_account_id();
+ if(! $account_id)
+ return;
+
+ import_account($a, $account_id);
+}
+
function import_content(&$a) {
if(! get_account_id()) {
diff --git a/mod/item.php b/mod/item.php
index 591dc8407..5f45a248b 100644
--- a/mod/item.php
+++ b/mod/item.php
@@ -474,6 +474,7 @@ function item_post(&$a) {
if($uid && $uid == $profile_uid && feature_enabled($uid,'markdown')) {
require_once('include/bb2diaspora.php');
$body = escape_tags($body);
+ $body = str_replace("\n",'<br />', $body);
$body = preg_replace_callback('/\[share(.*?)\]/ism','share_shield',$body);
$body = diaspora2bb($body,true);
$body = preg_replace_callback('/\[share(.*?)\]/ism','share_unshield',$body);