Merge pull request #1092 from annando/master

Bugfix: Messages when ignoring, blocking and archiving contacts now returns the correct text.
This commit is contained in:
tobiasd 2014-09-03 07:44:17 +02:00
commit ae2094487b
2 changed files with 14 additions and 15 deletions

View file

@ -4566,13 +4566,9 @@ function posted_dates($uid,$wall) {
if(! $dthen) if(! $dthen)
return array(); return array();
// If it's near the end of a long month, backup to the 28th so that in // Set the start and end date to the beginning of the month
// consecutive loops we'll always get a whole month difference. $dnow = substr($dnow,0,8).'01';
$dthen = substr($dthen,0,8).'01';
if(intval(substr($dnow,8)) > 28)
$dnow = substr($dnow,0,8) . '28';
if(intval(substr($dthen,8)) > 28)
$dnow = substr($dthen,0,8) . '28';
$ret = array(); $ret = array();
// Starting with the current month, get the first and last days of every // Starting with the current month, get the first and last days of every

View file

@ -278,7 +278,8 @@ 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);
@ -288,7 +289,8 @@ 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);
@ -299,7 +301,8 @@ 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);