* | Inspire Internet Relay Chat Daemon |
* +------------------------------------+
*
- * InspIRCd is copyright (C) 2002-2006 ChatSpike-Dev.
- * E-mail:
- * <brain@chatspike.net>
- * <Craig@chatspike.net>
- *
- * Written by Craig Edwards, Craig McLure, and others.
+ * InspIRCd: (C) 2002-2007 InspIRCd Development Team
+ * See: http://www.inspircd.org/wiki/index.php/Credits
+ *
* This program is free but copyrighted software; see
* the file COPYING for details.
*
* ---------------------------------------------------
*/
-
-using namespace std;
#include "users.h"
#include "channels.h"
userrec* u = (userrec*)(*iter);
ListData* ld;
u->GetExt("safelist_cache", ld);
- if ((size_t)ld->list_position > ServerInstance->chanlist.size())
+ if ((size_t)ld->list_position > ServerInstance->chanlist->size())
{
u->Shrink("safelist_cache");
DELETE(ld);
chan = ServerInstance->GetChannelIndex(ld->list_position);
/* spool details */
bool has_user = (chan && chan->HasUser(u));
- if ((chan) && (((!(chan->modes[CM_PRIVATE])) && (!(chan->modes[CM_SECRET]))) || (has_user)))
+ if ((chan) && (chan->modes[CM_PRIVATE]))
+ {
+ bool display = match(chan->name, ld->glob.c_str());
+ long users = chan->GetUserCounter();
+ if ((users) && (display))
+ {
+ int counter = snprintf(buffer, MAXBUF, "322 %s *", u->nick);
+ amount_sent += counter + ServerNameSize;
+ ServerInstance->Log(DEBUG, "m_safelist.so: Sent %ld of safe %ld / 4", amount_sent, u->sendqmax);
+ u->WriteServ(std::string(buffer));
+ }
+ }
+ else if ((chan) && (((!(chan->modes[CM_PRIVATE])) && (!(chan->modes[CM_SECRET]))) || (has_user)))
{
bool display = match(chan->name, ld->glob.c_str());
long users = chan->GetUserCounter();
virtual Version GetVersion()
{
- return Version(1,0,0,0,VF_VENDOR,API_VERSION);
+ return Version(1,1,0,0,VF_VENDOR,API_VERSION);
}
void Implements(char* List)
return 1;
}
+ /* Work around mIRC suckyness. YOU SUCK, KHALED! */
+ if ((pcnt == 1) && (*parameters[0] == '<'))
+ pcnt = 0;
+
time_t* last_list_time;
user->GetExt("safelist_last", last_list_time);
if (last_list_time)
if (ServerInstance->Time() < (*last_list_time)+60)
{
user->WriteServ("NOTICE %s :*** Woah there, slow down a little, you can't /LIST so often!",user->nick);
+ user->WriteServ("321 %s Channel :Users Name",user->nick);
+ user->WriteServ("323 %s :End of channel list.",user->nick);
return 1;
}