For a while, I've been using a script I wrote in order to delete ZNC accounts from our company server when people leave. The script has been working fine until something changed which resulted in the ZNC server returning an error instead of deleting the user.
Upon further inspection, it looks like some of the controlpanel commands require a colon in front of them in order to work. So, for example:
Weirdly, I only discovered the colon solution because I was running tcpdump at the server end while using irssi to send the commands my script sends and I noticed that when I typed:
/msg *controlpanel AddUser pcolmer pcolmer
the server actually received
PRIVMSG *controlpanel :AddUser pcolmer pcolmer
I have no idea how irssi knew to add that colon in.
For a while, I've been using a script I wrote in order to delete ZNC accounts from our company server when people leave. The script has been working fine until something changed which resulted in the ZNC server returning an error instead of deleting the user.
Upon further inspection, it looks like *some* of the controlpanel commands require a colon in front of them in order to work. So, for example:
PRIVMSG *controlpanel AddUser pcolmer pcolmer
:*controlpanel!znc@znc.in PRIVMSG linaro_znc :Usage: AddUser <username> <password>
That doesn't work but:
PRIVMSG *controlpanel :AddUser pcolmer pcolmer
:*controlpanel!znc@znc.in PRIVMSG linaro_znc :User pcolmer added!
does.
Curiously, for ListUsers, that seems to work with or without a leading colon:
```
PRIVMSG *controlpanel :ListUsers
:*controlpanel!znc@znc.in PRIVMSG linaro_znc :+------------+----------------------+---------+------------+-------------+------------+----------+
:*controlpanel!znc@znc.in PRIVMSG linaro_znc :| Username | Realname | IsAdmin | Nick | AltNick | Ident | BindHost |
:*controlpanel!znc@znc.in PRIVMSG linaro_znc :+------------+----------------------+---------+------------+-------------+------------+----------+
:*controlpanel!znc@znc.in PRIVMSG linaro_znc :| linaro_znc | ZNC - https://znc.in | Yes | linaro_znc | linaro_znc_ | linaro_znc | |
:*controlpanel!znc@znc.in PRIVMSG linaro_znc :+------------+----------------------+---------+------------+-------------+------------+----------+
PRIVMSG *controlpanel ListUsers
:*controlpanel!znc@znc.in PRIVMSG linaro_znc :+------------+----------------------+---------+------------+-------------+------------+----------+
:*controlpanel!znc@znc.in PRIVMSG linaro_znc :| Username | Realname | IsAdmin | Nick | AltNick | Ident | BindHost |
:*controlpanel!znc@znc.in PRIVMSG linaro_znc :+------------+----------------------+---------+------------+-------------+------------+----------+
:*controlpanel!znc@znc.in PRIVMSG linaro_znc :| linaro_znc | ZNC - https://znc.in | Yes | linaro_znc | linaro_znc_ | linaro_znc | |
:*controlpanel!znc@znc.in PRIVMSG linaro_znc :+------------+----------------------+---------+------------+-------------+------------+----------+
```
Is this a documented change or a bug in the code?
Weirdly, I only discovered the colon solution because I was running tcpdump at the server end while using irssi to send the commands my script sends and I noticed that when I typed:
/msg *controlpanel AddUser pcolmer pcolmer
the server actually received
PRIVMSG *controlpanel :AddUser pcolmer pcolmer
I have no idea how irssi knew to add that colon in.
<!-- github-sync-id:420031997 -->
The colon is part of the IRC spec. If the final parameter of a command (in this case, PRIVMSG) contains the space character, it must be prepended with a colon. irssi knew to put in the colon because your message contained a space.
If your script was not sending a colon, it was technically sending invalid lines.
The colon is part of the IRC spec. If the final parameter of a command (in this case, `PRIVMSG`) contains the space character, it must be prepended with a colon. irssi knew to put in the colon because your message contained a space.
If your script was not sending a colon, it was technically sending invalid lines.
<!-- github-comment-id:472042622 -->
The change that caused this is a rewrite of the IRC line parsing code. It now actually makes use of the requirements from the RFC to simplify some things. However, I think ZNC should still accept PRIVMSGs without the colon. It's a common mistake to make. Thus, reopening.
The change that caused this is a rewrite of the IRC line parsing code. It now actually makes use of the requirements from the RFC to simplify some things. However, I think ZNC should still accept `PRIVMSG`s without the colon. It's a common mistake to make. Thus, reopening.
<!-- github-comment-id:472074669 -->
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.
For a while, I've been using a script I wrote in order to delete ZNC accounts from our company server when people leave. The script has been working fine until something changed which resulted in the ZNC server returning an error instead of deleting the user.
Upon further inspection, it looks like some of the controlpanel commands require a colon in front of them in order to work. So, for example:
That doesn't work but:
does.
Curiously, for ListUsers, that seems to work with or without a leading colon:
Is this a documented change or a bug in the code?
Weirdly, I only discovered the colon solution because I was running tcpdump at the server end while using irssi to send the commands my script sends and I noticed that when I typed:
the server actually received
I have no idea how irssi knew to add that colon in.
The colon is part of the IRC spec. If the final parameter of a command (in this case,
PRIVMSG) contains the space character, it must be prepended with a colon. irssi knew to put in the colon because your message contained a space.If your script was not sending a colon, it was technically sending invalid lines.
Thank you for that explanation, @dgw.
The change that caused this is a rewrite of the IRC line parsing code. It now actually makes use of the requirements from the RFC to simplify some things. However, I think ZNC should still accept
PRIVMSGs without the colon. It's a common mistake to make. Thus, reopening.