Write a module which overrides CModule::OnUserTextMessage
Send a message to a channel
Observe that CModule::OnUserTextMessage is called with a CMessage whose GetChan() returns NULL.
Version: ZNC 1.7.x-git-755-8b48465d
Steps to reproduce:
1. Write a module which overrides `CModule::OnUserTextMessage`
2. Send a message to a channel
3. Observe that `CModule::OnUserTextMessage` is called with a `CMessage` whose `GetChan()` returns `NULL`.
<!-- github-sync-id:224717760 -->
That's because the old non-CMessage version of this callback didn't have CChan. But it makes sense to fill it when possible, yeah; the same for other functions.
This will introduce a caveat, that every module which uses GetChan() needs to check for nullptr. In some cases almost all calls of the callback are not nullptr, so the module writer can miss such check.
That's because the old non-CMessage version of this callback didn't have CChan. But it makes sense to fill it when possible, yeah; the same for other functions.
This will introduce a caveat, that every module which uses GetChan() needs to check for nullptr. In some cases almost all calls of the callback are not nullptr, so the module writer can miss such check.
<!-- github-comment-id:298442194 -->
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Version: ZNC 1.7.x-git-755-8b48465d
Steps to reproduce:
CModule::OnUserTextMessageCModule::OnUserTextMessageis called with aCMessagewhoseGetChan()returnsNULL.That's because the old non-CMessage version of this callback didn't have CChan. But it makes sense to fill it when possible, yeah; the same for other functions.
This will introduce a caveat, that every module which uses GetChan() needs to check for nullptr. In some cases almost all calls of the callback are not nullptr, so the module writer can miss such check.