function user_remove($uid) {
if(! $uid)
return;
- $a = get_app();
logger('Removing user: ' . $uid);
$r = q("select * from user where uid = %d limit 1", intval($uid));
if($uid == local_user()) {
unset($_SESSION['authenticated']);
unset($_SESSION['uid']);
- goaway($a->get_baseurl());
+ goaway(App::get_baseurl());
}
}
function terminate_friendship($user,$self,$contact) {
-
$a = get_app();
require_once('include/datetime.php');
if($contact['network'] === NETWORK_OSTATUS) {
- $slap = replace_macros(get_markup_template('follow_slap.tpl'), array(
- '$name' => $user['username'],
- '$profile_page' => $a->get_baseurl() . '/profile/' . $user['nickname'],
- '$photo' => $self['photo'],
- '$thumb' => $self['thumb'],
- '$published' => datetime_convert('UTC','UTC', 'now', ATOM_TIME),
- '$item_id' => 'urn:X-dfrn:' . $a->get_hostname() . ':unfollow:' . get_guid(32),
- '$title' => '',
- '$type' => 'text',
- '$content' => t('stopped following'),
- '$nick' => $user['nickname'],
- '$verb' => 'http://ostatus.org/schema/1.0/unfollow', // ACTIVITY_UNFOLLOW,
- '$ostat_follow' => '' // '<as:verb>http://ostatus.org/schema/1.0/unfollow</as:verb>' . "\r\n"
- ));
+ require_once('include/ostatus.php');
+
+ // create an unfollow slap
+ $item = array();
+ $item['verb'] = NAMESPACE_OSTATUS."/unfollow";
+ $item['follow'] = $contact["url"];
+ $slap = ostatus::salmon($item, $user);
if((x($contact,'notify')) && (strlen($contact['notify']))) {
require_once('include/salmon.php');
}
elseif($contact['network'] === NETWORK_DIASPORA) {
require_once('include/diaspora.php');
- diaspora::send_unshare($user,$contact);
+ Diaspora::send_unshare($user,$contact);
}
elseif($contact['network'] === NETWORK_DFRN) {
require_once('include/dfrn.php');
$sparkle = false;
if ($contact['network'] === NETWORK_DFRN) {
$sparkle = true;
- $profile_link = $a->get_baseurl() . '/redir/' . $contact['id'];
+ $profile_link = App::get_baseurl() . '/redir/' . $contact['id'];
} else {
$profile_link = $contact['url'];
}
}
if (in_array($contact['network'], array(NETWORK_DFRN, NETWORK_DIASPORA))) {
- $pm_url = $a->get_baseurl() . '/message/new/' . $contact['id'];
+ $pm_url = App::get_baseurl() . '/message/new/' . $contact['id'];
}
if ($contact['network'] == NETWORK_DFRN) {
- $poke_link = $a->get_baseurl() . '/poke/?f=&c=' . $contact['id'];
+ $poke_link = App::get_baseurl() . '/poke/?f=&c=' . $contact['id'];
}
- $contact_url = $a->get_baseurl() . '/contacts/' . $contact['id'];
+ $contact_url = App::get_baseurl() . '/contacts/' . $contact['id'];
- $posts_link = $a->get_baseurl() . '/contacts/' . $contact['id'] . '/posts';
- $contact_drop_link = $a->get_baseurl() . '/contacts/' . $contact['id'] . '/drop?confirm=1';
+ $posts_link = App::get_baseurl() . '/contacts/' . $contact['id'] . '/posts';
+ $contact_drop_link = App::get_baseurl() . '/contacts/' . $contact['id'] . '/drop?confirm=1';
/**
* menu array: