mirror of
https://github.com/znc/znc.git
synced 2026-05-05 13:02:31 +02:00
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:
@@ -617,6 +617,11 @@ CModule::EModRet CModule::OnIRCRegistration(CString& sPass, CString& sNick,
|
||||
}
|
||||
CModule::EModRet CModule::OnBroadcast(CString& sMessage) { return CONTINUE; }
|
||||
|
||||
void CModule::OnChanPermission3(const CNick* pOpNick, const CNick& Nick,
|
||||
CChan& Channel, char cMode,
|
||||
bool bAdded, bool bNoChange) {
|
||||
OnChanPermission2(pOpNick, Nick, Channel, cMode, bAdded, bNoChange);
|
||||
}
|
||||
void CModule::OnChanPermission2(const CNick* pOpNick, const CNick& Nick,
|
||||
CChan& Channel, unsigned char uMode,
|
||||
bool bAdded, bool bNoChange) {
|
||||
@@ -1144,6 +1149,13 @@ bool CModules::OnIRCDisconnected() {
|
||||
return false;
|
||||
}
|
||||
|
||||
bool CModules::OnChanPermission3(const CNick* pOpNick, const CNick& Nick,
|
||||
CChan& Channel, char cMode,
|
||||
bool bAdded, bool bNoChange) {
|
||||
MODUNLOADCHK(
|
||||
OnChanPermission3(pOpNick, Nick, Channel, cMode, bAdded, bNoChange));
|
||||
return false;
|
||||
}
|
||||
bool CModules::OnChanPermission2(const CNick* pOpNick, const CNick& Nick,
|
||||
CChan& Channel, unsigned char uMode,
|
||||
bool bAdded, bool bNoChange) {
|
||||
|
||||
Reference in New Issue
Block a user