a few fixes for offsite community members

This commit is contained in:
friendica 2012-02-16 18:29:09 -08:00
parent 6f6d4471d8
commit 2abbd81ce1
3 changed files with 35 additions and 6 deletions

View file

@ -312,6 +312,13 @@ function delivery_run($argv, $argc){
);
if(count($x)) {
if($owner['page-flags'] == PAGE_COMMUNITY && ! $x[0]['writable']) {
q("update contact set writable = 1 where id = %d limit 1",
intval($x[0]['id'])
);
$x[0]['writable'] = 1;
}
require_once('library/simplepie/simplepie.inc');
logger('mod-delivery: local delivery');
local_delivery($x[0],$atom);

View file

@ -999,7 +999,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 +1025,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 +1077,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 +1122,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 {

View file

@ -264,7 +264,7 @@ function notifier_run($argv, $argc){
$deny_people = expand_acl($parent['deny_cid']);
$deny_groups = expand_groups(expand_acl($parent['deny_gid']));
// if our parent is a forum, uplink to the origonal author causing
// if our parent is a forum, uplink to the origional author causing
// a delivery fork
if(intval($parent['forum_mode']) && (! $top_level) && ($cmd !== 'uplink')) {
@ -526,6 +526,14 @@ function notifier_run($argv, $argc){
);
if(count($x)) {
if($owner['page-flags'] == PAGE_COMMUNITY && ! $x[0]['writable']) {
q("update contact set writable = 1 where id = %d limit 1",
intval($x[0]['id'])
);
$x[0]['writable'] = 1;
}
require_once('library/simplepie/simplepie.inc');
logger('mod-delivery: local delivery');
local_delivery($x[0],$atom);