Make chan modes and permissions to be char instead of unsigned char.

Deprecate old module hooks which accept mode as unsigned char.

SWIG handles unsigned char as int, but char as a string.
Before this commit, usage of HasPerm from perl modules required this:
either $chan->HasPerm(ord('@')) or $chan->HasPerm(ord($ZNC::CChan::Op)).
Now ord() is not necessary, and these calls work too:
$chan->HasPerm('@') and $chan->HasPerm($ZNC::CChan::Op).

Fix #1486
This commit is contained in:
Alexey Sokolov
2018-02-10 15:49:53 +00:00
parent 9ff4127e33
commit a2470b3dd3
10 changed files with 127 additions and 99 deletions
+1 -1
View File
@@ -61,7 +61,7 @@ class CQModule : public CModule {
if (IsIRCConnected()) {
// check for usermode +x if we are already connected
set<unsigned char> scUserModes =
set<char> scUserModes =
GetNetwork()->GetIRCSock()->GetUserModes();
if (scUserModes.find('x') != scUserModes.end()) m_bCloaked = true;