don't allow removal of self contact
This commit is contained in:
parent
ef98c7e020
commit
9a52b15271
2 changed files with 4 additions and 3 deletions
|
@ -789,9 +789,10 @@ function diaspora_share($me,$contact) {
|
||||||
$myaddr = $me['nickname'] . '@' . substr($a->get_baseurl(), strpos($a->get_baseurl(),'://') + 3);
|
$myaddr = $me['nickname'] . '@' . substr($a->get_baseurl(), strpos($a->get_baseurl(),'://') + 3);
|
||||||
$theiraddr = $contact['addr'];
|
$theiraddr = $contact['addr'];
|
||||||
|
|
||||||
|
logger('diaspora_share: contact: ' . print_r($contact,true), LOGGER_DATA);
|
||||||
$tpl = get_markup_template('diaspora_share.tpl');
|
$tpl = get_markup_template('diaspora_share.tpl');
|
||||||
$msg = replace_macros($tpl, array(
|
$msg = replace_macros($tpl, array(
|
||||||
'$sender' => myaddr,
|
'$sender' => $myaddr,
|
||||||
'$recipient' => $theiraddr
|
'$recipient' => $theiraddr
|
||||||
));
|
));
|
||||||
|
|
||||||
|
|
|
@ -141,7 +141,7 @@ function contacts_content(&$a) {
|
||||||
|
|
||||||
$cmd = $a->argv[2];
|
$cmd = $a->argv[2];
|
||||||
|
|
||||||
$orig_record = q("SELECT * FROM `contact` WHERE `id` = %d AND `uid` = %d LIMIT 1",
|
$orig_record = q("SELECT * FROM `contact` WHERE `id` = %d AND `uid` = %d AND `self` = 0 LIMIT 1",
|
||||||
intval($contact_id),
|
intval($contact_id),
|
||||||
intval(local_user())
|
intval(local_user())
|
||||||
);
|
);
|
||||||
|
@ -222,7 +222,7 @@ function contacts_content(&$a) {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
contact_remove($contact_id);
|
contact_remove($orig_record[0]['id']);
|
||||||
info( t('Contact has been removed.') . EOL );
|
info( t('Contact has been removed.') . EOL );
|
||||||
goaway($a->get_baseurl() . '/contacts');
|
goaway($a->get_baseurl() . '/contacts');
|
||||||
return; // NOTREACHED
|
return; // NOTREACHED
|
||||||
|
|
Loading…
Reference in a new issue