diff options
Diffstat (limited to 'mod')
-rw-r--r-- | mod/contacts.php | 6 | ||||
-rw-r--r-- | mod/dfrn_notify.php | 31 | ||||
-rw-r--r-- | mod/follow.php | 2 | ||||
-rw-r--r-- | mod/network.php | 2 |
4 files changed, 34 insertions, 7 deletions
diff --git a/mod/contacts.php b/mod/contacts.php index 7236a200d..83f73140b 100644 --- a/mod/contacts.php +++ b/mod/contacts.php @@ -177,6 +177,12 @@ function contacts_content(&$a) { } } + if($orig_record[0]['network'] === 'dfrn') { + require_once('include/items.php'); + dfrn_deliver($a->user,$orig_record[0],'placeholder', 1); + } + + contact_remove($contact_id); notice( t('Contact has been removed.') . EOL ); goaway($a->get_baseurl() . '/contacts'); diff --git a/mod/dfrn_notify.php b/mod/dfrn_notify.php index 49356d358..f581702d8 100644 --- a/mod/dfrn_notify.php +++ b/mod/dfrn_notify.php @@ -11,6 +11,7 @@ function dfrn_notify_post(&$a) { $challenge = ((x($_POST,'challenge')) ? notags(trim($_POST['challenge'])) : ''); $data = ((x($_POST,'data')) ? $_POST['data'] : ''); $key = ((x($_POST,'key')) ? $_POST['key'] : ''); + $dissolve = ((x($_POST,'dissolve')) ? intval($_POST['dissolve']) : 0); $direction = (-1); if(strpos($dfrn_id,':') == 1) { @@ -51,6 +52,8 @@ function dfrn_notify_post(&$a) { } + + $r = q("SELECT `contact`.*, `contact`.`uid` AS `importer_uid`, `contact`.`pubkey` AS `cpubkey`, `contact`.`prvkey` AS `cprvkey`, `user`.* FROM `contact` LEFT JOIN `user` ON `contact`.`uid` = `user`.`uid` @@ -65,17 +68,24 @@ function dfrn_notify_post(&$a) { //NOTREACHED } + // $importer in this case contains the contact record for the remote contact joined with the user record of our user. + $importer = $r[0]; logger('dfrn_notify: received notify from ' . $importer['name'] . ' for ' . $importer['username']); logger('dfrn_notify: data: ' . $data, LOGGER_DATA); - if($importer['readonly']) { - // We aren't receiving stuff from this person. But we will quietly ignore them - // rather than a blatant "go away" message. - logger('dfrn_notify: ignoring'); + if($dissolve == 1) { + + /** + * Relationship is dissolved permanently + */ + + require_once('include/Contact.php'); + contact_remove($importer['id']); + logger('relationship dissolved : ' . $importer['name'] . ' dissolved ' . $importer['username']); xml_status(0); - //NOTREACHED + } if(strlen($key)) { @@ -95,6 +105,17 @@ function dfrn_notify_post(&$a) { logger('rino: decrypted data: ' . $data, LOGGER_DATA); } + + + + if($importer['readonly']) { + // We aren't receiving stuff from this person. But we will quietly ignore them + // rather than a blatant "go away" message. + logger('dfrn_notify: ignoring'); + xml_status(0); + //NOTREACHED + } + // Consume notification feed. This may differ from consuming a public feed in several ways // - might contain email // - might contain remote followup to our message diff --git a/mod/follow.php b/mod/follow.php index bad2e74f9..946794c87 100644 --- a/mod/follow.php +++ b/mod/follow.php @@ -110,7 +110,7 @@ function follow_post(&$a) { if((! $vcard['photo']) && strlen($email)) $vcard['photo'] = gravatar_img($email); $network = 'feed'; - } + } } logger('follow: poll=' . $poll . ' notify=' . $notify . ' profile=' . $profile . ' vcard=' . print_r($vcard,true)); diff --git a/mod/network.php b/mod/network.php index 083912f86..50d7134c1 100644 --- a/mod/network.php +++ b/mod/network.php @@ -244,7 +244,7 @@ function network_content(&$a, $update = 0) { '$lock' => $lock, '$thumb' => $profile_avatar, '$title' => $item['title'], - '$body' => bbcode($item['body']), + '$body' => smilies(bbcode($item['body'])), '$ago' => relative_date($item['created']), '$location' => $location, '$indent' => '', |