fixing bug #12283 which is a fix for the fix in #12135

- hopefully now working for both...


git-svn-id: file:///svn/phpbb/trunk@7735 89ea8834-ac86-4346-8a33-228a782c2dd0
This commit is contained in:
Meik Sievertsen 2007-06-09 08:31:32 +00:00
parent 5d90161ba4
commit cbf7b00cb8

View file

@ -498,12 +498,13 @@ function place_pm_into_folder(&$global_privmsgs_rules, $release = false)
// We place actions into arrays, to save queries. // We place actions into arrays, to save queries.
$num_new = $num_unread = 0; $num_new = $num_unread = 0;
$sql = $unread_ids = $delete_ids = $important_ids = $move_into_folder = array(); $sql = $unread_ids = $delete_ids = $important_ids = array();
foreach ($action_ary as $msg_id => $msg_ary) foreach ($action_ary as $msg_id => $msg_ary)
{ {
// It is allowed to execute actions more than once, except placing messages into folder // It is allowed to execute actions more than once, except placing messages into folder
$folder_action = false; $folder_action = false;
$message_removed = false;
foreach ($msg_ary as $pos => $rule_ary) foreach ($msg_ary as $pos => $rule_ary)
{ {
@ -526,15 +527,11 @@ function place_pm_into_folder(&$global_privmsgs_rules, $release = false)
{ {
$unread_ids[] = $msg_id; $unread_ids[] = $msg_id;
} }
if (!$folder_action)
{
$move_into_folder[PRIVMSGS_INBOX][] = $msg_id;
}
break; break;
case ACTION_DELETE_MESSAGE: case ACTION_DELETE_MESSAGE:
$delete_ids[] = $msg_id; $delete_ids[] = $msg_id;
$message_removed = true;
break; break;
case ACTION_MARK_AS_IMPORTANT: case ACTION_MARK_AS_IMPORTANT:
@ -542,14 +539,16 @@ function place_pm_into_folder(&$global_privmsgs_rules, $release = false)
{ {
$important_ids[] = $msg_id; $important_ids[] = $msg_id;
} }
if (!$folder_action)
{
$move_into_folder[PRIVMSGS_INBOX][] = $msg_id;
}
break; break;
} }
} }
// We place this here because it could happen that the messages are doubled if a rule marks a message and then moves it into a specific
// folder. Here we simply move the message into the INBOX if it gets not removed and also not put into a custom folder.
if (!$folder_action && !$message_removed)
{
$move_into_folder[PRIVMSGS_INBOX][] = $msg_id;
}
} }
// $num_new += sizeof(array_unique($delete_ids)); // $num_new += sizeof(array_unique($delete_ids));