Skip to content

Refactor server chat handling by extracting methods#3741

Merged
ann0see merged 4 commits into
jamulussoftware:mainfrom
dingodoppelt:refactor_chat
Jun 21, 2026
Merged

Refactor server chat handling by extracting methods#3741
ann0see merged 4 commits into
jamulussoftware:mainfrom
dingodoppelt:refactor_chat

Conversation

@dingodoppelt

@dingodoppelt dingodoppelt commented Jun 17, 2026

Copy link
Copy Markdown
Member

Short description of changes

This refactors CServer::CreateAndSendChatTextForAllConChannels into three functions for sending messages.
The extracted methods

  1. create the full chat message including timestamp and name of the sending client,
  2. iterate over all possible channel numbers to
  3. send the message text to a channel

As it is now possible to call the function to send a message to a channel directly, the channel number needs to be boundary checked.
A function InRange() was introduced into util.h for that purpose.

CHANGELOG: Refactor server chat handling by extracting methods

Context: Fixes an issue?

Not yet ;)

Does this change need documentation? What needs to be documented and how?
No

Status of this Pull Request

Ready for review
What is missing until this pull request can be merged?

Review, Approval

Checklist

  • I've verified that this Pull Request follows the general code principles
  • I tested my code and it does what I want
  • My code follows the style guide
  • I waited some time after this Pull Request was opened and all GitHub checks completed without errors.
  • I've filled all the content above

Comment thread src/util.h
Comment thread src/util.h
Comment thread src/util.h Outdated
Comment thread src/server.cpp Outdated
dingodoppelt and others added 3 commits June 18, 2026 19:54
Co-authored-by: Peter L Jones <pljones@users.noreply.github.com>
Co-authored-by: Peter L Jones <pljones@users.noreply.github.com>
Comment thread src/server.cpp
@ann0see ann0see merged commit 753daac into jamulussoftware:main Jun 21, 2026
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

refactoring Non-behavioural changes, Code cleanup

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants