return znc.HALTCORE ignored in OnJoinMessage #1044

Open
opened 2026-10-05 05:00:14 +02:00 by adam · 1 comment
Owner

I'm trying to stop join messages: ZNC -> CLI.
The znc -D shows the block of code running but the message still being sent to CLI.

Am I doing something wrong or is this a bug?

import znc

class testblockjoinmsg(znc.Module):
    """
    test blocking messages.
    """
    description = "another test appl"
    has_args = False

    def OnJoinMessage(self, msg):
        print(f'JOIN message to block: {msg}')
        return znc.HALTCORE

"""
OUTPUT from znc -D
[2024-05-25 11:40:09.268554] (x/libera) IRC -> ZNC [@time=2024-05-25T18:40:09.194Z;account=Throgkt :Throgkt!~Throgkt@user/throgkt JOIN #linux Throgkt :Throgkt]
JOIN message to block: @account=Throgkt;time=2024-05-25T18:40:09.194Z :Throgkt!~Throgkt@user/throgkt JOIN #linux Throgkt :Throgkt
[2024-05-25 11:40:09.269775] (x/libera) ZNC -> CLI [@time=2024-05-25T18:40:09.194Z :Throgkt!~Throgkt@user/throgkt JOIN #linux]
"""
I'm trying to stop join messages: ZNC -> CLI. The znc -D shows the block of code running but the message still being sent to CLI. Am I doing something wrong or is this a bug? ``` import znc class testblockjoinmsg(znc.Module): """ test blocking messages. """ description = "another test appl" has_args = False def OnJoinMessage(self, msg): print(f'JOIN message to block: {msg}') return znc.HALTCORE """ OUTPUT from znc -D [2024-05-25 11:40:09.268554] (x/libera) IRC -> ZNC [@time=2024-05-25T18:40:09.194Z;account=Throgkt :Throgkt!~Throgkt@user/throgkt JOIN #linux Throgkt :Throgkt] JOIN message to block: @account=Throgkt;time=2024-05-25T18:40:09.194Z :Throgkt!~Throgkt@user/throgkt JOIN #linux Throgkt :Throgkt [2024-05-25 11:40:09.269775] (x/libera) ZNC -> CLI [@time=2024-05-25T18:40:09.194Z :Throgkt!~Throgkt@user/throgkt JOIN #linux] """ ``` <!-- github-sync-id:2317189440 -->
Author
Owner
That's because of `NOTHING` in https://github.com/znc/znc/blob/82e82f0bf6f643839612968db668e135757129b4/src/IRCSock.cpp#L551 No idea why it's like this... <!-- github-comment-id:2131405542 -->
Sign in to join this conversation.
No labels
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: adam/znc#1044