diff options
author | Adam- <Adam-@5417fbe8-f217-4b02-8779-1006273d7864> | 2010-02-04 23:49:27 +0000 |
---|---|---|
committer | Adam- <Adam-@5417fbe8-f217-4b02-8779-1006273d7864> | 2010-02-04 23:49:27 +0000 |
commit | 308070e01971b0cfaf77de20011f48ce4d6b5a1c (patch) | |
tree | 2bdfd84e35cf79eb20dc2a79ddd233789ca84fdf /src/memoserv.c | |
parent | 3d4cf39940144be19645a3a7cdecf95213b96f26 (diff) |
We now store a list of users using a NickCore in the NickCore, this prevents having to loop every user all the time to find them
git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/trunk@2780 5417fbe8-f217-4b02-8779-1006273d7864
Diffstat (limited to 'src/memoserv.c')
-rw-r--r-- | src/memoserv.c | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/src/memoserv.c b/src/memoserv.c index 1a60a88bc..1db5aa06d 100644 --- a/src/memoserv.c +++ b/src/memoserv.c @@ -89,7 +89,7 @@ void check_memos(User * u) return; } - if (!(nc = u->nc) || !u->IsRecognized() || + if (!(nc = u->Account()) || !u->IsRecognized() || !(nc->HasFlag(NI_MEMO_SIGNON))) { return; } @@ -195,8 +195,8 @@ void memo_send(User * u, const char *name, const char *text, int z) Memo *m; MemoInfo *mi; time_t now = time(NULL); - char *source = u->nc->display; - int is_servoper = u->nc && u->nc->IsServicesOper(); + char *source = u->Account()->display; + int is_servoper = u->Account() && u->Account()->IsServicesOper(); if (readonly) { notice_lang(Config.s_MemoServ, u, MEMO_SEND_DISABLED); @@ -207,7 +207,7 @@ void memo_send(User * u, const char *name, const char *text, int z) if (z == 3) syntax_error(Config.s_MemoServ, u, "RSEND", MEMO_RSEND_SYNTAX); - } else if (!nick_identified(u) && !u->IsRecognized()) { + } else if (!u->IsIdentified() && !u->IsRecognized()) { if (z == 0 || z == 3) notice_lang(Config.s_MemoServ, u, NICK_IDENTIFY_REQUIRED, Config.s_NickServ); @@ -281,13 +281,14 @@ void memo_send(User * u, const char *name, const char *text, int z) for (i = 0; i < nc->aliases.count; i++) { na = static_cast<NickAlias *>(nc->aliases.list[i]); - if (finduser(na->nick) && nick_identified(finduser(na->nick))) - notice_lang(Config.s_MemoServ, finduser(na->nick), + User *user = finduser(na->nick); + if (user && user->IsIdentified()) + notice_lang(Config.s_MemoServ, user, MEMO_NEW_MEMO_ARRIVED, source, Config.s_MemoServ, m->number); } } else { - if ((u = finduser(name)) && nick_identified(u) + if ((u = finduser(name)) && u->IsIdentified() && (nc->HasFlag(NI_MEMO_RECEIVE))) notice_lang(Config.s_MemoServ, u, MEMO_NEW_MEMO_ARRIVED, source, Config.s_MemoServ, m->number); @@ -307,8 +308,8 @@ void memo_send(User * u, const char *name, const char *text, int z) UserContainer *cu = *it; if (check_access(cu->user, c->ci, CA_MEMO)) { - if (cu->user->nc - && (cu->user->nc->HasFlag(NI_MEMO_RECEIVE)) + if (cu->user->Account() + && (cu->user->Account()->HasFlag(NI_MEMO_RECEIVE)) && get_ignore(cu->user->nick.c_str()) == NULL) { notice_lang(Config.s_MemoServ, cu->user, MEMO_NEW_X_MEMO_ARRIVED, |