The script deals with the event OnConfMessage:
// ---------------------------------------
// Script created by Alexey Pikurov ([email protected])
// 17.01.2021 12:24:45
// ---------------------------------------
const
NOTIFY_FLAG = true; // true/false: notify a user that he can't write messages in a conference
RESTRICTED_CONFS = '|main|work|sales|Chief|';
ALLOWED_ROLES = '|Administrators|Operators|';
function OnConfMessage(iCID, iUIN, iUID, iMsgType: integer; sConfName, sMsg: string): boolean;
var
sRoleName: string;
bFlag: boolean;
begin
bFlag := true;
if pos('|' + sConfName + '|', RESTRICTED_CONFS) <> 0 then begin
sRoleName := mGetUserRoleName(iUIN);
if pos('|' + sConfName + '|', ALLOWED_ROLES) = 0 then begin
bFlag := false;
if NOTIFY_FLAG then
mSendCustomMsgToClientConsoleByCID(iCID,
'Sorry, but you can not send messages to the conference #main' + sConfName,
'Status', true, true, 74);
end;
end;
result := bFlag;
end;
begin
end.