diff options
author | Friendika <info@friendika.com> | 2010-11-23 19:29:38 -0800 |
---|---|---|
committer | Friendika <info@friendika.com> | 2010-11-23 19:29:38 -0800 |
commit | f9f08b435589ea10dca2db6891ae885a66e831e4 (patch) | |
tree | 6d378de75dd173bc6a6a9486347f1da1282e4d36 /mod/contacts.php | |
parent | 81e1e4245b54604bf6b89ceb91f2e5e1128a317a (diff) | |
download | volse-hubzilla-f9f08b435589ea10dca2db6891ae885a66e831e4.tar.gz volse-hubzilla-f9f08b435589ea10dca2db6891ae885a66e831e4.tar.bz2 volse-hubzilla-f9f08b435589ea10dca2db6891ae885a66e831e4.zip |
send unfollow before removing ostatus contact
Diffstat (limited to 'mod/contacts.php')
-rw-r--r-- | mod/contacts.php | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/mod/contacts.php b/mod/contacts.php index 3e23fa86b..29ef8a8cd 100644 --- a/mod/contacts.php +++ b/mod/contacts.php @@ -146,6 +146,31 @@ function contacts_content(&$a) { } if($cmd === 'drop') { + + // create an unfollow slap + + if($orig_record[0]['network'] === 'stat') { + $tpl = load_view_file('view/follow_slap.tpl'); + $slap = replace_macros($tpl, array( + '$name' => $a->user['username'], + '$profile_page' => $a->get_baseurl() . '/profile/' . $a->user['nickname'], + '$photo' => $a->contact['photo'], + '$thumb' => $a->contact['thumb'], + '$published' => datetime_convert('UTC','UTC', 'now', ATOM_TIME), + '$item_id' => 'urn:X-dfrn:' . $a->get_hostname() . ':unfollow:' . random_string(), + '$title' => '', + '$type' => 'text', + '$content' => t('stopped following'), + '$nick' => $a->user['nickname'], + '$verb' => ACTIVITY_UNFOLLOW + )); + + if((x($orig_record[0],'notify')) && (strlen($orig_record[0]['notify']))) { + require_once('include/salmon.php'); + slapper($a->user,$orig_record[0]['notify'],$slap); + } + } + contact_remove($contact_id); notice( t('Contact has been removed.') . EOL ); goaway($a->get_baseurl() . '/contacts'); |