[ticket/11103] Remove unnecessary comments

Comments that are not needed because the actions are completely
self-explanatory

PHPBB3-11103
This commit is contained in:
Nathan Guse 2012-10-18 18:32:13 -05:00
parent 883a961720
commit ae670cc87d
9 changed files with 0 additions and 28 deletions

View file

@ -130,7 +130,6 @@ $phpbb_subscriber_loader = $phpbb_container->get('event.subscriber_loader');
$template = $phpbb_container->get('template'); $template = $phpbb_container->get('template');
$phpbb_style = $phpbb_container->get('style'); $phpbb_style = $phpbb_container->get('style');
// Notifications manager
$phpbb_notifications = $phpbb_container->get('notification_manager'); $phpbb_notifications = $phpbb_container->get('notification_manager');
$ids = array_keys($phpbb_container->findTaggedServiceIds('container.processor')); $ids = array_keys($phpbb_container->findTaggedServiceIds('container.processor'));

View file

@ -1386,7 +1386,6 @@ function markread($mode, $forum_id = false, $topic_id = false, $post_time = 0, $
$forum_id = array($forum_id); $forum_id = array($forum_id);
} }
// Mark topic notifications read for this user in this forum
$phpbb_notifications->mark_notifications_read_by_parent(array('topic', 'approve_topic'), $forum_id, $user->data['user_id'], $post_time); $phpbb_notifications->mark_notifications_read_by_parent(array('topic', 'approve_topic'), $forum_id, $user->data['user_id'], $post_time);
// Mark all post/quote notifications read for this user in this forum // Mark all post/quote notifications read for this user in this forum

View file

@ -716,7 +716,6 @@ function delete_topics($where_type, $where_ids, $auto_sync = true, $post_count_s
set_config_count('num_topics', $approved_topics * (-1), true); set_config_count('num_topics', $approved_topics * (-1), true);
} }
// Delete notifications
$phpbb_notifications->delete_notifications(array('topic', 'approve_topic', 'topic_in_queue'), $topic_ids); $phpbb_notifications->delete_notifications(array('topic', 'approve_topic', 'topic_in_queue'), $topic_ids);
return $return; return $return;
@ -897,7 +896,6 @@ function delete_posts($where_type, $where_ids, $auto_sync = true, $posted_sync =
delete_topics('topic_id', $remove_topics, $auto_sync, $post_count_sync, false); delete_topics('topic_id', $remove_topics, $auto_sync, $post_count_sync, false);
} }
// Delete notifications
$phpbb_notifications->delete_notifications(array('quote', 'bookmark', 'post', 'approve_post', 'post_in_queue'), $post_ids); $phpbb_notifications->delete_notifications(array('quote', 'bookmark', 'post', 'approve_post', 'post_in_queue'), $post_ids);
return sizeof($post_ids); return sizeof($post_ids);

View file

@ -878,7 +878,6 @@ function update_unread_status($unread, $msg_id, $user_id, $folder_id)
global $db, $user, $phpbb_notifications; global $db, $user, $phpbb_notifications;
// Mark the PM as read
$phpbb_notifications->mark_notifications_read('pm', $msg_id, $user_id); $phpbb_notifications->mark_notifications_read('pm', $msg_id, $user_id);
$sql = 'UPDATE ' . PRIVMSGS_TO_TABLE . " $sql = 'UPDATE ' . PRIVMSGS_TO_TABLE . "
@ -1097,7 +1096,6 @@ function delete_pm($user_id, $msg_ids, $folder_id)
$user->data['user_unread_privmsg'] -= $num_unread; $user->data['user_unread_privmsg'] -= $num_unread;
} }
// Delete Notifications
$phpbb_notifications->delete_notifications('pm', array_keys($delete_rows)); $phpbb_notifications->delete_notifications('pm', array_keys($delete_rows));
// Now we have to check which messages we can delete completely // Now we have to check which messages we can delete completely
@ -1262,7 +1260,6 @@ function phpbb_delete_user_pms($user_id)
AND ' . $db->sql_in_set('msg_id', $delivered_msg); AND ' . $db->sql_in_set('msg_id', $delivered_msg);
$db->sql_query($sql); $db->sql_query($sql);
// Delete Notifications
$phpbb_notifications->delete_notifications('pm', $delivered_msg); $phpbb_notifications->delete_notifications('pm', $delivered_msg);
} }
@ -1276,7 +1273,6 @@ function phpbb_delete_user_pms($user_id)
WHERE ' . $db->sql_in_set('msg_id', $undelivered_msg); WHERE ' . $db->sql_in_set('msg_id', $undelivered_msg);
$db->sql_query($sql); $db->sql_query($sql);
// Delete Notifications
$phpbb_notifications->delete_notifications('pm', $undelivered_msg); $phpbb_notifications->delete_notifications('pm', $undelivered_msg);
} }
} }
@ -1321,7 +1317,6 @@ function phpbb_delete_user_pms($user_id)
WHERE ' . $db->sql_in_set('msg_id', $delete_ids); WHERE ' . $db->sql_in_set('msg_id', $delete_ids);
$db->sql_query($sql); $db->sql_query($sql);
// Delete Notifications
$phpbb_notifications->delete_notifications('pm', $delete_ids); $phpbb_notifications->delete_notifications('pm', $delete_ids);
} }
} }

View file

@ -90,7 +90,6 @@ class mcp_pm_reports
trigger_error('NO_REPORT'); trigger_error('NO_REPORT');
} }
// Mark the notification as read
$phpbb_notifications->mark_notifications_read_by_parent('report_pm', $report_id, $user->data['user_id']); $phpbb_notifications->mark_notifications_read_by_parent('report_pm', $report_id, $user->data['user_id']);
$pm_id = $report['pm_id']; $pm_id = $report['pm_id'];

View file

@ -86,7 +86,6 @@ class mcp_queue
{ {
$post_id = (int) $topic_info[$topic_id]['topic_first_post_id']; $post_id = (int) $topic_info[$topic_id]['topic_first_post_id'];
// Mark the notification as read
$phpbb_notifications->mark_notifications_read('topic_in_queue', $topic_id, $user->data['user_id']); $phpbb_notifications->mark_notifications_read('topic_in_queue', $topic_id, $user->data['user_id']);
} }
else else
@ -95,7 +94,6 @@ class mcp_queue
} }
} }
// Mark the notification as read
$phpbb_notifications->mark_notifications_read('post_in_queue', $post_id, $user->data['user_id']); $phpbb_notifications->mark_notifications_read('post_in_queue', $post_id, $user->data['user_id']);
$post_info = get_post_data(array($post_id), 'm_approve', true); $post_info = get_post_data(array($post_id), 'm_approve', true);
@ -612,13 +610,10 @@ function approve_post($post_id_list, $id, $mode)
{ {
if ($post_id == $post_data['topic_first_post_id'] && $post_id == $post_data['topic_last_post_id']) if ($post_id == $post_data['topic_first_post_id'] && $post_id == $post_data['topic_last_post_id'])
{ {
// Delete topic in queue notifications
$phpbb_notifications->delete_notifications(array('topic_in_queue'), $post_data['topic_id']); $phpbb_notifications->delete_notifications(array('topic_in_queue'), $post_data['topic_id']);
// Forum Notifications
$phpbb_notifications->add_notifications('topic', $post_data); $phpbb_notifications->add_notifications('topic', $post_data);
// Notify poster?
if ($notify_poster) if ($notify_poster)
{ {
$phpbb_notifications->add_notifications('approve_topic', $post_data); $phpbb_notifications->add_notifications('approve_topic', $post_data);
@ -626,13 +621,10 @@ function approve_post($post_id_list, $id, $mode)
} }
else else
{ {
// Delete post in queue notification
$phpbb_notifications->delete_notifications(array('post_in_queue'), $post_id); $phpbb_notifications->delete_notifications(array('post_in_queue'), $post_id);
// Topic Notifications
$phpbb_notifications->add_notifications(array('quote', 'bookmark', 'post'), $post_data); $phpbb_notifications->add_notifications(array('quote', 'bookmark', 'post'), $post_data);
// Notify poster?
if ($notify_poster) if ($notify_poster)
{ {
$phpbb_notifications->add_notifications('approve_post', $post_data); $phpbb_notifications->add_notifications('approve_post', $post_data);
@ -859,7 +851,6 @@ function disapprove_post($post_id_list, $id, $mode)
} }
} }
// Handle notifications (topic/post in queue)
foreach ($post_info as $post_id => $post_data) foreach ($post_info as $post_id => $post_data)
{ {
if ($post_id == $post_data['topic_first_post_id'] && $post_id == $post_data['topic_last_post_id']) if ($post_id == $post_data['topic_first_post_id'] && $post_id == $post_data['topic_last_post_id'])
@ -912,7 +903,6 @@ function disapprove_post($post_id_list, $id, $mode)
if ($post_id == $post_data['topic_first_post_id'] && $post_id == $post_data['topic_last_post_id']) if ($post_id == $post_data['topic_first_post_id'] && $post_id == $post_data['topic_last_post_id'])
{ {
// Notify poster?
if ($notify_poster) if ($notify_poster)
{ {
$phpbb_notifications->add_notifications('disapprove_topic', $post_data); $phpbb_notifications->add_notifications('disapprove_topic', $post_data);
@ -920,7 +910,6 @@ function disapprove_post($post_id_list, $id, $mode)
} }
else else
{ {
// Notify poster?
if ($notify_poster) if ($notify_poster)
{ {
$phpbb_notifications->add_notifications('disapprove_post', $post_data); $phpbb_notifications->add_notifications('disapprove_post', $post_data);

View file

@ -88,7 +88,6 @@ class mcp_reports
trigger_error('NO_REPORT'); trigger_error('NO_REPORT');
} }
// Mark the notification as read
$phpbb_notifications->mark_notifications_read('report_post', $post_id, $user->data['user_id']); $phpbb_notifications->mark_notifications_read('report_post', $post_id, $user->data['user_id']);
if (!$report_id && $report['report_closed']) if (!$report_id && $report['report_closed'])

View file

@ -50,12 +50,10 @@ class ucp_notifications
{ {
if ($request->is_set_post($type . '_notification') && !isset($subscriptions[$type])) if ($request->is_set_post($type . '_notification') && !isset($subscriptions[$type]))
{ {
// add
$phpbb_notifications->add_subscription($type); $phpbb_notifications->add_subscription($type);
} }
else if (!$request->is_set_post($type . '_notification') && isset($subscriptions[$type])) else if (!$request->is_set_post($type . '_notification') && isset($subscriptions[$type]))
{ {
// remove
$phpbb_notifications->delete_subscription($type); $phpbb_notifications->delete_subscription($type);
} }
@ -63,12 +61,10 @@ class ucp_notifications
{ {
if ($request->is_set_post($type . '_' . $method) && (!isset($subscriptions[$type]) || !in_array($method, $subscriptions[$type]))) if ($request->is_set_post($type . '_' . $method) && (!isset($subscriptions[$type]) || !in_array($method, $subscriptions[$type])))
{ {
// add
$phpbb_notifications->add_subscription($type, 0, $method); $phpbb_notifications->add_subscription($type, 0, $method);
} }
else if (!$request->is_set_post($type . '_' . $method) && isset($subscriptions[$type]) && in_array($method, $subscriptions[$type])) else if (!$request->is_set_post($type . '_' . $method) && isset($subscriptions[$type]) && in_array($method, $subscriptions[$type]))
{ {
// remove
$phpbb_notifications->delete_subscription($type, 0, $method); $phpbb_notifications->delete_subscription($type, 0, $method);
} }
} }

View file

@ -185,7 +185,6 @@ if ($submit && $reason_id)
$lang_return = $user->lang['RETURN_TOPIC']; $lang_return = $user->lang['RETURN_TOPIC'];
$lang_success = $user->lang['POST_REPORTED_SUCCESS']; $lang_success = $user->lang['POST_REPORTED_SUCCESS'];
// Notify relevant users
$phpbb_notifications->add_notifications('report_post', array_merge($report_data, $row, $forum_data, array( $phpbb_notifications->add_notifications('report_post', array_merge($report_data, $row, $forum_data, array(
'report_text' => $report_text, 'report_text' => $report_text,
))); )));
@ -216,7 +215,6 @@ if ($submit && $reason_id)
$lang_return = $user->lang['RETURN_PM']; $lang_return = $user->lang['RETURN_PM'];
$lang_success = $user->lang['PM_REPORTED_SUCCESS']; $lang_success = $user->lang['PM_REPORTED_SUCCESS'];
// Notify relevant users
$phpbb_notifications->add_notifications('report_pm', array_merge($report_data, $row, array( $phpbb_notifications->add_notifications('report_pm', array_merge($report_data, $row, array(
'report_text' => $report_text, 'report_text' => $report_text,
'from_user_id' => $report_data['author_id'], 'from_user_id' => $report_data['author_id'],