mirror of
https://github.com/Dingo-Shenanigans/ReSkate.git
synced 2026-10-23 14:15:53 +02:00
Merge pull request #310 from moelrobi/fix/poll-answer-repeat
Polls: answers no longer refused as repeats, and less chat noise
This commit is contained in:
7 files changed
+79
-23
No files matched your search
@@ -1318,8 +1318,10 @@ void Host::receive(std::uint64_t peer, std::span<const std::uint8_t> bytes, std:
|
||||
if (p.kind == PacketKind::physics_tuning || p.kind == PacketKind::physics_extras) return;
|
||||
if (p.kind == PacketKind::chat) {
|
||||
active(*link);
|
||||
// An answer to the running vote may repeat the line before it: the same /2 in the next poll.
|
||||
const bool answer = p.text.starts_with('/') && answers_vote(*link, std::string_view(p.text).substr(1));
|
||||
if (!routed_source(p, link->member, peer, true, id_) ||
|
||||
link->chat_rate.accept(now_, p.text, 1) != ChatRate::Verdict::accepted)
|
||||
link->chat_rate.accept(now_, p.text, 1, answer) != ChatRate::Verdict::accepted)
|
||||
return;
|
||||
link->last_packet = now_;
|
||||
if (!allowed_words(*link, p.text)) return;
|
||||
|
||||
Reference in new issue
Block a user