1
0
mirror of https://github.com/anope/anope.git synced 2026-06-29 06:06:37 +02:00

Added os_forbid

This commit is contained in:
Adam
2011-05-06 18:02:53 -04:00
parent b59602abf8
commit fd4b52ec38
66 changed files with 586 additions and 702 deletions
+4 -12
View File
@@ -39,29 +39,21 @@ class MyMemoServService : public MemoServService
return MemoServ;
}
MemoInfo *GetMemoInfo(const Anope::string &target, bool &ischan, bool &isforbid)
MemoInfo *GetMemoInfo(const Anope::string &target, bool &ischan)
{
isforbid = false;
if (!target.empty() && target[0] == '#')
{
ischan = true;
ChannelInfo *ci = cs_findchan(target);
if (ci != NULL)
{
isforbid = ci->HasFlag(CI_FORBIDDEN);
return &ci->memos;
}
}
else
{
ischan = false;
NickAlias *na = findnick(target);
if (na != NULL)
{
isforbid = na->HasFlag(NS_FORBIDDEN);
return &na->nc->memos;
}
}
return NULL;
@@ -69,10 +61,10 @@ class MyMemoServService : public MemoServService
MemoResult Send(const Anope::string &source, const Anope::string &target, const Anope::string &message, bool force)
{
bool ischan, isforbid;
MemoInfo *mi = this->GetMemoInfo(target, ischan, isforbid);
bool ischan;
MemoInfo *mi = this->GetMemoInfo(target, ischan);
if (mi == NULL || isforbid == true)
if (mi == NULL)
return MEMO_INVALID_TARGET;
User *sender = finduser(source);