#2863 - Chat archive PT posts count towards points
| Identifier | #2863 |
|---|---|
| Issue type | Minor issue (breaks specific functionality) |
| Title | Chat archive PT posts count towards points |
| Status | Completed |
| Handling member | Chris Graham |
| Addon | chat |
| Description | When sending chat messages, they create a post in the archives in private topics. Because private topic posts count towards points, that means so do chat archive posts. This means instead of users getting points for chat message, they're getting points for chat message AND a post. |
| Steps to reproduce | |
| Funded? | No |
The system will post a comment when this issue is modified (e.g., status changes). To be notified of this, click "Enable comment notifications".


Comments
Found in sources/chat.php line 957.
POSSIBLE Fix (untested):
cns_make_post($topic_id, $is_starter ? do_lang('INSTANT_MESSAGING_CONVO') : '', $message, 0, $is_starter, 1, 0, null, null, null, get_member(), $members[0] === get_member() ? $members[1] : $members[0], null, null, false, true, null, false, '', 0, null, false, true);
What this does is set an intended_solely_for value to the ID of the user the message is being sent to, which is not counted towards post points when set.
___
EDIT: I was wrong. This does NOT work.
in the cns_force_update_member_post_count function of sources/cns_posts_action.php, find:
$map = array('p_poster' => $member_id, 'p_cache_forum_id' => null);
if (addon_installed('unvalidated')) {
$map['p_validated'] = 1;
}
$member_post_count += $GLOBALS['FORUM_DB']->query_select_value('f_posts', 'COUNT(*)', $map);
Comment out:
$member_post_count += $GLOBALS['FORUM_DB']->query_select_value('f_posts', 'COUNT(*)', $map);
This will cause caching to not count private topic posts towards a member's post count. That's the unfortunate consequence of this fudge, but at least it stops counting private topic posts towards points, especially when it comes to chat archive posts.
I could be wrong though.
I tested manually making a PT, doing an IM, and in both cases the post count remained the same. The point calculation was correct. I cleared the topic cache and same result.
As your final post pointed out, the post count is only calculated for non-private topics.