From dd908c841538374dd6156cc57f5e743cf51d8048 Mon Sep 17 00:00:00 2001 From: Michael Vogel Date: Wed, 3 Sep 2014 01:03:23 +0200 Subject: [PATCH 1/2] Bugfix: Messages when ignoring, blocking and archiving contacts now returns the correct messages. --- mod/contacts.php | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/mod/contacts.php b/mod/contacts.php index 0c5373622..b212803b3 100644 --- a/mod/contacts.php +++ b/mod/contacts.php @@ -268,7 +268,7 @@ function contacts_content(&$a) { goaway($a->get_baseurl(true) . '/contacts'); return; // NOTREACHED } - + if($cmd === 'update') { _contact_update($contact_id); goaway($a->get_baseurl(true) . '/contacts/' . $contact_id); @@ -278,9 +278,10 @@ function contacts_content(&$a) { if($cmd === 'block') { $r = _contact_block($contact_id, $orig_record[0]); 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); return; // NOTREACHED } @@ -288,9 +289,10 @@ function contacts_content(&$a) { if($cmd === 'ignore') { $r = _contact_ignore($contact_id, $orig_record[0]); 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); return; // NOTREACHED } @@ -299,9 +301,10 @@ function contacts_content(&$a) { if($cmd === 'archive') { $r = _contact_archive($contact_id, $orig_record[0]); 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); return; // NOTREACHED } From 500dbecfe75b75a3079a08138a61fad060f3fc6b Mon Sep 17 00:00:00 2001 From: Michael Vogel Date: Wed, 3 Sep 2014 01:43:04 +0200 Subject: [PATCH 2/2] Fix for issue #1060 (Missing Entries in Archive Dropdown) --- include/items.php | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/include/items.php b/include/items.php index 93bdcb4c3..f9e0203c2 100644 --- a/include/items.php +++ b/include/items.php @@ -4566,13 +4566,9 @@ function posted_dates($uid,$wall) { if(! $dthen) return array(); - // If it's near the end of a long month, backup to the 28th so that in - // consecutive loops we'll always get a whole month difference. - - if(intval(substr($dnow,8)) > 28) - $dnow = substr($dnow,0,8) . '28'; - if(intval(substr($dthen,8)) > 28) - $dnow = substr($dthen,0,8) . '28'; + // Set the start and end date to the beginning of the month + $dnow = substr($dnow,0,8).'01'; + $dthen = substr($dthen,0,8).'01'; $ret = array(); // Starting with the current month, get the first and last days of every