Bugfix: Messages when ignoring, blocking and archiving contacts now returns the correct messages.

This commit is contained in:
Michael Vogel 2014-09-03 01:03:23 +02:00
parent 7144d22cc1
commit dd908c8415
1 changed files with 11 additions and 8 deletions

View File

@ -268,7 +268,7 @@ function contacts_content(&$a) {
goaway($a->get_baseurl(true) . '/contacts'); goaway($a->get_baseurl(true) . '/contacts');
return; // NOTREACHED return; // NOTREACHED
} }
if($cmd === 'update') { if($cmd === 'update') {
_contact_update($contact_id); _contact_update($contact_id);
goaway($a->get_baseurl(true) . '/contacts/' . $contact_id); goaway($a->get_baseurl(true) . '/contacts/' . $contact_id);
@ -278,9 +278,10 @@ function contacts_content(&$a) {
if($cmd === 'block') { if($cmd === 'block') {
$r = _contact_block($contact_id, $orig_record[0]); $r = _contact_block($contact_id, $orig_record[0]);
if($r) { if($r) {
info( (($blocked) ? t('Contact has been blocked') : t('Contact has been unblocked')) . EOL ); $blocked = (($orig_record[0]['blocked']) ? 0 : 1);
info((($blocked) ? t('Contact has been blocked') : t('Contact has been unblocked')).EOL);
} }
goaway($a->get_baseurl(true) . '/contacts/' . $contact_id); goaway($a->get_baseurl(true) . '/contacts/' . $contact_id);
return; // NOTREACHED return; // NOTREACHED
} }
@ -288,9 +289,10 @@ function contacts_content(&$a) {
if($cmd === 'ignore') { if($cmd === 'ignore') {
$r = _contact_ignore($contact_id, $orig_record[0]); $r = _contact_ignore($contact_id, $orig_record[0]);
if($r) { if($r) {
info( (($readonly) ? t('Contact has been ignored') : t('Contact has been unignored')) . EOL ); $readonly = (($orig_record[0]['readonly']) ? 0 : 1);
info((($readonly) ? t('Contact has been ignored') : t('Contact has been unignored')).EOL);
} }
goaway($a->get_baseurl(true) . '/contacts/' . $contact_id); goaway($a->get_baseurl(true) . '/contacts/' . $contact_id);
return; // NOTREACHED return; // NOTREACHED
} }
@ -299,9 +301,10 @@ function contacts_content(&$a) {
if($cmd === 'archive') { if($cmd === 'archive') {
$r = _contact_archive($contact_id, $orig_record[0]); $r = _contact_archive($contact_id, $orig_record[0]);
if($r) { if($r) {
info( (($archived) ? t('Contact has been archived') : t('Contact has been unarchived')) . EOL ); $archived = (($orig_record[0]['archive']) ? 0 : 1);
} info((($archived) ? t('Contact has been archived') : t('Contact has been unarchived')).EOL);
}
goaway($a->get_baseurl(true) . '/contacts/' . $contact_id); goaway($a->get_baseurl(true) . '/contacts/' . $contact_id);
return; // NOTREACHED return; // NOTREACHED
} }