Commit 0eaba921 authored by Chris Graham's avatar Chris Graham
Browse files

Fixed MANTIS-4298 (Complex member mention notification redirection issue)

parent b5c4c92d
Loading
Loading
Loading
Loading
+12 −5
Original line number Diff line number Diff line
@@ -296,6 +296,18 @@ function cns_make_post($topic_id, $title, $post, $skip_sig = 0, $is_starter = fa

    @ignore_user_abort(false);

    if (!$is_pt) {
        /*
        The !$is_pt check is needed because it would get out of control if mentions were sent for notifications saved in private topics.
        We call dispatch_member_mention_notifications early so that mentions collected during Comcode parsing for other notifications won't pollute our member mention pool.
        */

        cms_profile_start_for('cns_make_post:dispatch_member_mention_notifications');
        require_code('member_mentions');
        dispatch_member_mention_notifications('post', strval($post_id), $anonymous ? db_get_first_id() : $poster);
        cms_profile_end_for('cns_make_post:dispatch_member_mention_notifications');
    }

    $_url = build_url(array('page' => 'topicview', 'type' => 'findpost', 'id' => $post_id), 'forum', null, false, false, true, 'post_' . strval($post_id));
    $url = $_url->evaluate();
    if ($validated == 0) {
@@ -437,11 +449,6 @@ function cns_make_post($topic_id, $title, $post, $skip_sig = 0, $is_starter = fa
        cms_profile_end_for('cns_make_post:generate_resource_fs_moniker');
    }

    cms_profile_start_for('cns_make_post:dispatch_member_mention_notifications');
    require_code('member_mentions');
    dispatch_member_mention_notifications('post', strval($post_id), $anonymous ? db_get_first_id() : $poster);
    cms_profile_end_for('cns_make_post:dispatch_member_mention_notifications');

    if (($is_starter) && (!$is_pt) && (!is_null($forum_id))) {
        require_code('sitemap_xml');
        notify_sitemap_node_add('_SEARCH:topicview:id=' . strval($topic_id), $time, $last_edit_time, SITEMAP_IMPORTANCE_LOW, 'daily', has_category_access($GLOBALS['FORUM_DRIVER']->get_guest_id(), 'forums', strval($forum_id)));