that was ugly - let's do better

This commit is contained in:
Friendika 2011-08-23 19:42:45 -07:00
parent 838d89a110
commit b57a01dc14

View file

@ -619,17 +619,18 @@ function notifier_run($argv, $argc){
); );
if(count($n)) { if(count($n)) {
switch($n[0]['network']) { $contact = $n[0];
switch($contact['network']) {
case NETWORK_DFRN : case NETWORK_DFRN :
logger('notifier: dfrnpubdelivery: ' . $n[0]['name']); logger('notifier: dfrnpubdelivery: ' . $contact['name']);
$deliver_status = dfrn_deliver($owner,$n[0],$atom); $deliver_status = dfrn_deliver($owner,$contact,$atom);
break; break;
case NETWORK_DIASPORA : case NETWORK_DIASPORA :
require_once('include/diaspora.php'); require_once('include/diaspora.php');
if(get_config('system','dfrn_only') || (! get_config('system','diaspora_enabled')) || (! $normal_mode)) if(get_config('system','dfrn_only') || (! get_config('system','diaspora_enabled')) || (! $normal_mode))
break; break;
if(! $n[0]['pubkey']) if(! $contact['pubkey'])
break; break;
if($target_item['verb'] === ACTIVITY_DISLIKE) { if($target_item['verb'] === ACTIVITY_DISLIKE) {
@ -638,21 +639,21 @@ function notifier_run($argv, $argc){
} }
elseif(($target_item['deleted']) && ($target_item['verb'] !== ACTIVITY_LIKE)) { elseif(($target_item['deleted']) && ($target_item['verb'] !== ACTIVITY_LIKE)) {
// diaspora delete, // diaspora delete,
diaspora_send_retraction($target_item,$owner,$n[0]); diaspora_send_retraction($target_item,$owner,$contact);
break; break;
} }
elseif($followup) { elseif($followup) {
// send comments, likes and retractions of likes to owner to relay // send comments, likes and retractions of likes to owner to relay
diaspora_send_followup($target_item,$owner,$n[0]); diaspora_send_followup($target_item,$owner,$contact);
break; break;
} }
elseif($target_item['parent'] != $target_item['id']) { elseif($target_item['parent'] != $target_item['id']) {
// we are the relay - send comments, likes and unlikes to our conversants // we are the relay - send comments, likes and unlikes to our conversants
diaspora_send_relay($target_item,$owner,$n[0]); diaspora_send_relay($target_item,$owner,$contact);
break; break;
} }
elseif($top_level) { elseif($top_level) {
diaspora_send_status($target_item,$owner,$n[0]); diaspora_send_status($target_item,$owner,$contact);
break; break;
} }
default: default: