Add module callback OnNumeric #567

Closed
opened 2026-10-05 04:30:18 +02:00 by adam · 0 comments
Owner

A lot of modules parse numerics in OnRaw, and having a dedicated numeric callback will help produce cleaner and faster modules (skipping all events like PRIVMSG, NOTICE, and avoiding the parsing of modules).

Here is the command I tried to execute to find the results: grep 'OnRaw' modules/*.cpp -C 15 | grep -E 'Equals\("..."\)|== "..."'

block_motd.cpp-         if (sCmd == "375" /* begin of MOTD */
block_motd.cpp-                         || sCmd == "372" /* MOTD */)
block_motd.cpp-         if (sCmd == "376" /* End of MOTD */) {
keepnick.cpp-           if (m_pTimer && sLine.Token(1) == "433" && sLine.Token(3).Equals(GetNick()))
modules_online.cpp-             if (sLine.Token(1) == "303" && !m_ISONRequests.empty()) {
partyline.cpp-          if (sLine.Token(1) == "005") {
q.cpp-          if (sLine.Token(1) == "396" && sLine.Token(3).find("users.quakenet.org") != CString::npos) {
route_replies.cpp-              if (sCmd == "461") {
sasl.cpp-               } else if (sLine.Token(1).Equals("903")) {
sasl.cpp-               } else if (sLine.Token(1).Equals("904") || sLine.Token(1).Equals("905")) {

// Only in PR 1068
stickychan.cpp-         if (sNumeric.Equals("479")) {
A lot of modules parse numerics in OnRaw, and having a dedicated numeric callback will help produce cleaner and faster modules (skipping all events like PRIVMSG, NOTICE, and avoiding the parsing of modules). Here is the command I tried to execute to find the results: `grep 'OnRaw' modules/*.cpp -C 15 | grep -E 'Equals\("..."\)|== "..."'` ``` block_motd.cpp- if (sCmd == "375" /* begin of MOTD */ block_motd.cpp- || sCmd == "372" /* MOTD */) block_motd.cpp- if (sCmd == "376" /* End of MOTD */) { keepnick.cpp- if (m_pTimer && sLine.Token(1) == "433" && sLine.Token(3).Equals(GetNick())) modules_online.cpp- if (sLine.Token(1) == "303" && !m_ISONRequests.empty()) { partyline.cpp- if (sLine.Token(1) == "005") { q.cpp- if (sLine.Token(1) == "396" && sLine.Token(3).find("users.quakenet.org") != CString::npos) { route_replies.cpp- if (sCmd == "461") { sasl.cpp- } else if (sLine.Token(1).Equals("903")) { sasl.cpp- } else if (sLine.Token(1).Equals("904") || sLine.Token(1).Equals("905")) { // Only in PR 1068 stickychan.cpp- if (sNumeric.Equals("479")) { ``` <!-- github-sync-id:105204345 -->
adam closed this issue 2026-10-05 04:30:18 +02:00
Sign in to join this conversation.
No labels
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: adam/znc#567