zorael / kameloso

IRC bot with Twitch support
Boost Software License 1.0
9 stars 3 forks source link

The Printer plugin does not print counts and altcounts of 0 #105

Closed zorael closed 3 years ago

zorael commented 3 years ago

In plugins/printer/formatting.d, function formatMessageMonochrome:

    if (event.count != 0)
    {
        // BUG: the 0 in "time since idle 0 seconds" does not get printed
        .put(sink, " {", event.count, '}');
    }

    if (event.altcount != 0)
    {
        // As above
        .put(sink, " {", event.altcount, '}');
    }

Similarly in function formatMessageColoured.

The only way around it is to change IRCEvent's count and altcount members to have default values that realistically never occur naturally, such as int.min. This would require tagging a new minor release of dialect however.