Skip to content

Commit fe80967

Browse files
committed
[ticket/12990] Use the full services name for the notification's types
PHPBB3-12990
1 parent e9f5b9d commit fe80967

35 files changed

Lines changed: 231 additions & 118 deletions

phpBB/includes/acp/acp_users.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -404,7 +404,7 @@ function main($id, $mode)
404404
if ($config['require_activation'] == USER_ACTIVATION_ADMIN)
405405
{
406406
$phpbb_notifications = $phpbb_container->get('notification_manager');
407-
$phpbb_notifications->delete_notifications('admin_activate_user', $user_row['user_id']);
407+
$phpbb_notifications->delete_notifications('notification.type.admin_activate_user', $user_row['user_id']);
408408

409409
include_once($phpbb_root_path . 'includes/functions_messenger.' . $phpEx);
410410

phpBB/includes/functions.php

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1146,12 +1146,12 @@ function markread($mode, $forum_id = false, $topic_id = false, $post_time = 0, $
11461146

11471147
// Mark all topic notifications read for this user
11481148
$phpbb_notifications->mark_notifications_read(array(
1149-
'topic',
1150-
'quote',
1151-
'bookmark',
1152-
'post',
1153-
'approve_topic',
1154-
'approve_post',
1149+
'notification.type.topic',
1150+
'notification.type.quote',
1151+
'notification.type.bookmark',
1152+
'notification.type.post',
1153+
'notification.type.approve_topic',
1154+
'notification.type.approve_post',
11551155
), false, $user->data['user_id'], $post_time);
11561156

11571157
if ($config['load_db_lastread'] && $user->data['is_registered'])
@@ -1211,8 +1211,8 @@ function markread($mode, $forum_id = false, $topic_id = false, $post_time = 0, $
12111211
$phpbb_notifications = $phpbb_container->get('notification_manager');
12121212

12131213
$phpbb_notifications->mark_notifications_read_by_parent(array(
1214-
'topic',
1215-
'approve_topic',
1214+
'notification.type.topic',
1215+
'notification.type.approve_topic',
12161216
), $forum_id, $user->data['user_id'], $post_time);
12171217

12181218
// Mark all post/quote notifications read for this user in this forum
@@ -1228,10 +1228,10 @@ function markread($mode, $forum_id = false, $topic_id = false, $post_time = 0, $
12281228
$db->sql_freeresult($result);
12291229

12301230
$phpbb_notifications->mark_notifications_read_by_parent(array(
1231-
'quote',
1232-
'bookmark',
1233-
'post',
1234-
'approve_post',
1231+
'notification.type.quote',
1232+
'notification.type.bookmark',
1233+
'notification.type.post',
1234+
'notification.type.approve_post',
12351235
), $topic_ids, $user->data['user_id'], $post_time);
12361236

12371237
// Add 0 to forums array to mark global announcements correctly
@@ -1334,15 +1334,15 @@ function markread($mode, $forum_id = false, $topic_id = false, $post_time = 0, $
13341334

13351335
// Mark post notifications read for this user in this topic
13361336
$phpbb_notifications->mark_notifications_read(array(
1337-
'topic',
1338-
'approve_topic',
1337+
'notification.type.topic',
1338+
'notification.type.approve_topic',
13391339
), $topic_id, $user->data['user_id'], $post_time);
13401340

13411341
$phpbb_notifications->mark_notifications_read_by_parent(array(
1342-
'quote',
1343-
'bookmark',
1344-
'post',
1345-
'approve_post',
1342+
'notification.type.quote',
1343+
'notification.type.bookmark',
1344+
'notification.type.post',
1345+
'notification.type.approve_post',
13461346
), $topic_id, $user->data['user_id'], $post_time);
13471347

13481348
if ($config['load_db_lastread'] && $user->data['is_registered'])

phpBB/includes/functions_admin.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -722,9 +722,9 @@ function delete_topics($where_type, $where_ids, $auto_sync = true, $post_count_s
722722
$phpbb_notifications = $phpbb_container->get('notification_manager');
723723

724724
$phpbb_notifications->delete_notifications(array(
725-
'topic',
726-
'approve_topic',
727-
'topic_in_queue',
725+
'notification.type.topic',
726+
'notification.type.approve_topic',
727+
'notification.type.topic_in_queue',
728728
), $topic_ids);
729729

730730
return $return;
@@ -739,9 +739,9 @@ function delete_posts($where_type, $where_ids, $auto_sync = true, $posted_sync =
739739

740740
// Notifications types to delete
741741
$delete_notifications_types = array(
742-
'quote',
743-
'approve_post',
744-
'post_in_queue',
742+
'notification.type.quote',
743+
'notification.type.approve_post',
744+
'notification.type.post_in_queue',
745745
);
746746

747747
/**

phpBB/includes/functions_posting.php

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -2256,17 +2256,17 @@ function submit_post($mode, $subject, $username, $topic_type, &$poll, &$data, $u
22562256
{
22572257
case 'post':
22582258
$phpbb_notifications->add_notifications(array(
2259-
'quote',
2260-
'topic',
2259+
'notification.type.quote',
2260+
'notification.type.topic',
22612261
), $notification_data);
22622262
break;
22632263

22642264
case 'reply':
22652265
case 'quote':
22662266
$phpbb_notifications->add_notifications(array(
2267-
'quote',
2268-
'bookmark',
2269-
'post',
2267+
'notification.type.quote',
2268+
'notification.type.bookmark',
2269+
'notification.type.post',
22702270
), $notification_data);
22712271
break;
22722272

@@ -2275,10 +2275,10 @@ function submit_post($mode, $subject, $username, $topic_type, &$poll, &$data, $u
22752275
case 'edit':
22762276
case 'edit_last_post':
22772277
$phpbb_notifications->update_notifications(array(
2278-
'quote',
2279-
'bookmark',
2280-
'topic',
2281-
'post',
2278+
'notification.type.quote',
2279+
'notification.type.bookmark',
2280+
'notification.type.topic',
2281+
'notification.type.post',
22822282
), $notification_data);
22832283
break;
22842284
}
@@ -2288,12 +2288,12 @@ function submit_post($mode, $subject, $username, $topic_type, &$poll, &$data, $u
22882288
switch ($mode)
22892289
{
22902290
case 'post':
2291-
$phpbb_notifications->add_notifications('topic_in_queue', $notification_data);
2291+
$phpbb_notifications->add_notifications('notification.type.topic_in_queue', $notification_data);
22922292
break;
22932293

22942294
case 'reply':
22952295
case 'quote':
2296-
$phpbb_notifications->add_notifications('post_in_queue', $notification_data);
2296+
$phpbb_notifications->add_notifications('notification.type.post_in_queue', $notification_data);
22972297
break;
22982298

22992299
case 'edit_topic':
@@ -2310,20 +2310,20 @@ function submit_post($mode, $subject, $username, $topic_type, &$poll, &$data, $u
23102310
{
23112311
case 'edit_topic':
23122312
case 'edit_first_post':
2313-
$phpbb_notifications->add_notifications('topic_in_queue', $notification_data);
2313+
$phpbb_notifications->add_notifications('notification.type.topic_in_queue', $notification_data);
23142314

23152315
// Delete the approve_post notification so we can notify the user again,
23162316
// when his post got reapproved
2317-
$phpbb_notifications->delete_notifications('approve_post', $notification_data['post_id']);
2317+
$phpbb_notifications->delete_notifications('notification.type.approve_post', $notification_data['post_id']);
23182318
break;
23192319

23202320
case 'edit':
23212321
case 'edit_last_post':
2322-
$phpbb_notifications->add_notifications('post_in_queue', $notification_data);
2322+
$phpbb_notifications->add_notifications('notification.type.post_in_queue', $notification_data);
23232323

23242324
// Delete the approve_post notification so we can notify the user again,
23252325
// when his post got reapproved
2326-
$phpbb_notifications->delete_notifications('approve_post', $notification_data['post_id']);
2326+
$phpbb_notifications->delete_notifications('notification.type.approve_post', $notification_data['post_id']);
23272327
break;
23282328

23292329
case 'post':

phpBB/includes/functions_privmsgs.php

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -883,7 +883,7 @@ function update_unread_status($unread, $msg_id, $user_id, $folder_id)
883883

884884
$phpbb_notifications = $phpbb_container->get('notification_manager');
885885

886-
$phpbb_notifications->mark_notifications_read('pm', $msg_id, $user_id);
886+
$phpbb_notifications->mark_notifications_read('notification.type.pm', $msg_id, $user_id);
887887

888888
$sql = 'UPDATE ' . PRIVMSGS_TO_TABLE . "
889889
SET pm_unread = 0
@@ -1114,7 +1114,7 @@ function delete_pm($user_id, $msg_ids, $folder_id)
11141114

11151115
$phpbb_notifications = $phpbb_container->get('notification_manager');
11161116

1117-
$phpbb_notifications->delete_notifications('pm', array_keys($delete_rows));
1117+
$phpbb_notifications->delete_notifications('notification.type.pm', array_keys($delete_rows));
11181118

11191119
// Now we have to check which messages we can delete completely
11201120
$sql = 'SELECT msg_id
@@ -1296,7 +1296,7 @@ function phpbb_delete_users_pms($user_ids)
12961296
AND ' . $db->sql_in_set('msg_id', $delivered_msg);
12971297
$db->sql_query($sql);
12981298

1299-
$phpbb_notifications->delete_notifications('pm', $delivered_msg);
1299+
$phpbb_notifications->delete_notifications('notification.type.pm', $delivered_msg);
13001300
}
13011301

13021302
if (!empty($undelivered_msg))
@@ -1309,7 +1309,7 @@ function phpbb_delete_users_pms($user_ids)
13091309
WHERE ' . $db->sql_in_set('msg_id', $undelivered_msg);
13101310
$db->sql_query($sql);
13111311

1312-
$phpbb_notifications->delete_notifications('pm', $undelivered_msg);
1312+
$phpbb_notifications->delete_notifications('notification.type.pm', $undelivered_msg);
13131313
}
13141314
}
13151315

@@ -1353,7 +1353,7 @@ function phpbb_delete_users_pms($user_ids)
13531353
WHERE ' . $db->sql_in_set('msg_id', $delete_ids);
13541354
$db->sql_query($sql);
13551355

1356-
$phpbb_notifications->delete_notifications('pm', $delete_ids);
1356+
$phpbb_notifications->delete_notifications('notification.type.pm', $delete_ids);
13571357
}
13581358
}
13591359

@@ -1911,11 +1911,11 @@ function submit_pm($mode, $subject, &$data, $put_in_outbox = true)
19111911

19121912
if ($mode == 'edit')
19131913
{
1914-
$phpbb_notifications->update_notifications('pm', $pm_data);
1914+
$phpbb_notifications->update_notifications('notification.type.pm', $pm_data);
19151915
}
19161916
else
19171917
{
1918-
$phpbb_notifications->add_notifications('pm', $pm_data);
1918+
$phpbb_notifications->add_notifications('notification.type.pm', $pm_data);
19191919
}
19201920

19211921
/**

phpBB/includes/functions_user.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2675,7 +2675,7 @@ function group_user_add($group_id, $user_id_ary = false, $username_ary = false,
26752675

26762676
foreach ($add_id_ary as $user_id)
26772677
{
2678-
$phpbb_notifications->add_notifications('group_request', array(
2678+
$phpbb_notifications->add_notifications('notification.type.group_request', array(
26792679
'group_id' => $group_id,
26802680
'user_id' => $user_id,
26812681
'group_name' => $group_name,
@@ -2832,7 +2832,7 @@ function group_user_del($group_id, $user_id_ary = false, $username_ary = false,
28322832

28332833
$phpbb_notifications = $phpbb_container->get('notification_manager');
28342834

2835-
$phpbb_notifications->delete_notifications('group_request', $user_id_ary, $group_id);
2835+
$phpbb_notifications->delete_notifications('notification.type.group_request', $user_id_ary, $group_id);
28362836

28372837
// Return false - no error
28382838
return false;
@@ -2996,12 +2996,12 @@ function group_user_attributes($action, $group_id, $user_id_ary = false, $userna
29962996

29972997
$phpbb_notifications = $phpbb_container->get('notification_manager');
29982998

2999-
$phpbb_notifications->add_notifications('group_request_approved', array(
2999+
$phpbb_notifications->add_notifications('notification.type.group_request_approved', array(
30003000
'user_ids' => $user_id_ary,
30013001
'group_id' => $group_id,
30023002
'group_name' => $group_name,
30033003
));
3004-
$phpbb_notifications->delete_notifications('group_request', $user_id_ary, $group_id);
3004+
$phpbb_notifications->delete_notifications('notification.type.group_request', $user_id_ary, $group_id);
30053005

30063006
$log = 'LOG_USERS_APPROVED';
30073007
break;

phpBB/includes/mcp/mcp_pm_reports.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ function main($id, $mode)
9595

9696
$phpbb_notifications = $phpbb_container->get('notification_manager');
9797

98-
$phpbb_notifications->mark_notifications_read_by_parent('report_pm', $report_id, $user->data['user_id']);
98+
$phpbb_notifications->mark_notifications_read_by_parent('notification.type.report_pm', $report_id, $user->data['user_id']);
9999

100100
$pm_id = $report['pm_id'];
101101
$report_id = $report['report_id'];

0 commit comments

Comments
 (0)