Skip to content

Conversation

@konard
Copy link
Member

@konard konard commented Sep 14, 2025

Summary

This PR fixes issue #18 by preventing users from voting on bot messages, specifically karma change messages.

Changes Made

  • Added a check in apply_karma() method to prevent voting when the target user has a negative UID (bot/group messages)
  • This prevents users from voting on karma change messages posted by the bot

Problem Solved

Previously, when a user voted on another user's message:

  1. User A votes "++" on User B's message
  2. Bot deletes User A's vote and posts "Карма изменена: [User B] [5]->[6]"
  3. Users could vote on the bot's karma change message (unwanted behavior)

Now, votes on bot messages (UIDs < 0) are silently ignored, preventing "votes on votes".

Test Plan

  • Verified syntax is correct
  • Tested logic with mock users (positive UIDs allow voting, negative UIDs prevent voting)
  • Confirmed the fix targets the specific issue without affecting normal voting functionality

🤖 Generated with Claude Code


Resolves #18

Adding CLAUDE.md with task information for AI processing.
This file will be removed when the task is complete.

Issue: #18
@konard konard self-assigned this Sep 14, 2025
Added check to prevent voting on bot/group messages (UIDs < 0).
This prevents users from voting on karma change messages posted by the bot.

Fixes #18

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <[email protected]>
@konard konard changed the title [WIP] Disable votes on votes Fix: Disable votes on votes (#18) Sep 14, 2025
@konard konard marked this pull request as ready for review September 14, 2025 03:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Disable votes on votes

2 participants