mirror of
https://github.com/anope/anope.git
synced 2026-06-25 05:56:38 +02:00
Merge branch '1.9' of ssh://anope.git.sourceforge.net/gitroot/anope/anope into 1.9
This commit is contained in:
@@ -49,7 +49,7 @@ class MemoListCallback : public NumberList
|
||||
class CommandMSRead : public Command
|
||||
{
|
||||
public:
|
||||
CommandMSRead() : Command("READ", 0, 2)
|
||||
CommandMSRead() : Command("READ", 1, 2)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -59,8 +59,7 @@ class CommandMSRead : public Command
|
||||
|
||||
MemoInfo *mi;
|
||||
ChannelInfo *ci = NULL;
|
||||
Anope::string numstr = !params.empty() ? params[0] : "", chan;
|
||||
int num;
|
||||
Anope::string numstr = params[0], chan;
|
||||
|
||||
if (!numstr.empty() && numstr[0] == '#')
|
||||
{
|
||||
@@ -81,8 +80,8 @@ class CommandMSRead : public Command
|
||||
}
|
||||
else
|
||||
mi = &u->Account()->memos;
|
||||
num = !numstr.empty() && numstr.is_number_only() ? convertTo<int>(numstr) : -1;
|
||||
if (numstr.empty() || (!numstr.equals_ci("LAST") && !numstr.equals_ci("NEW") && num <= 0))
|
||||
|
||||
if (numstr.empty() || (!numstr.equals_ci("LAST") && !numstr.equals_ci("NEW") && !numstr.is_number_only()))
|
||||
this->OnSyntaxError(source, numstr);
|
||||
else if (mi->memos.empty())
|
||||
{
|
||||
@@ -91,7 +90,8 @@ class CommandMSRead : public Command
|
||||
else
|
||||
source.Reply(MEMO_HAVE_NO_MEMOS);
|
||||
}
|
||||
else {
|
||||
else
|
||||
{
|
||||
int i, end;
|
||||
|
||||
if (numstr.equals_ci("NEW"))
|
||||
|
||||
@@ -906,6 +906,18 @@ class DBMySQL : public Module
|
||||
}
|
||||
}
|
||||
|
||||
r = SQL->RunQuery("SELECT * FROM `anope_os_exceptions`");
|
||||
for (int i = 0; i < r.Rows(); ++i)
|
||||
{
|
||||
Anope::string mask = r.Get(i, "mask");
|
||||
unsigned limit = convertTo<unsigned>(r.Get(i, "slimit"));
|
||||
Anope::string creator = r.Get(i, "who");
|
||||
Anope::string reason = r.Get(i, "reason");
|
||||
time_t expires = convertTo<time_t>(r.Get(i, "expires"));
|
||||
|
||||
exception_add(NULL, mask, limit, reason, creator, expires);
|
||||
}
|
||||
|
||||
r = SQL->RunQuery("SELECT * FROM `anope_extra`");
|
||||
for (int i = 0; i < r.Rows(); ++i)
|
||||
{
|
||||
@@ -1371,7 +1383,7 @@ class DBMySQL : public Module
|
||||
this->Escape(m->sender) + "', '" + this->Escape(m->text) + "', 'CHAN')");
|
||||
}
|
||||
|
||||
void OnMemoDel(NickCore *nc, MemoInfo *mi, Memo *m)
|
||||
void OnMemoDel(const NickCore *nc, MemoInfo *mi, Memo *m)
|
||||
{
|
||||
if (m)
|
||||
this->RunQuery("DELETE FROM `anope_ms_info` WHERE `receiver` = '" + this->Escape(nc->display) + "' AND `time` = " + stringify(m->time));
|
||||
|
||||
@@ -153,6 +153,7 @@ class CommandHSActivate : public Command
|
||||
if (it != Requests.end())
|
||||
{
|
||||
na->hostinfo.SetVhost(it->second->ident, it->second->host, u->nick, it->second->time);
|
||||
FOREACH_MOD(I_OnSetVhost, OnSetVhost(na));
|
||||
|
||||
if (HSRequestMemoUser)
|
||||
memo_send(source, na->nick, _("[auto memo] Your requested vHost has been approved."), 2);
|
||||
|
||||
@@ -72,7 +72,7 @@ class SocketEnginePoll : public SocketEngineBase
|
||||
return;
|
||||
}
|
||||
|
||||
if (pos->second != SocketCount)
|
||||
if (pos->second != SocketCount - 1)
|
||||
{
|
||||
pollfd *ev = &this->events[pos->second],
|
||||
*last_ev = &this->events[SocketCount - 1];
|
||||
@@ -137,9 +137,13 @@ class SocketEnginePoll : public SocketEngineBase
|
||||
return;
|
||||
}
|
||||
|
||||
for (int i = 0; i < total; ++i)
|
||||
for (int i = 0, processed = 0; i < SocketCount && processed != total; ++i)
|
||||
{
|
||||
pollfd *ev = &this->events[i];
|
||||
|
||||
if (ev->revents != 0)
|
||||
++processed;
|
||||
|
||||
Socket *s = Sockets[ev->fd];
|
||||
|
||||
if (s->HasFlag(SF_DEAD))
|
||||
|
||||
@@ -73,10 +73,13 @@ class SocketEngineSelect : public SocketEngineBase
|
||||
}
|
||||
else if (sresult)
|
||||
{
|
||||
for (std::map<int, Socket *>::const_iterator it = Sockets.begin(), it_end = Sockets.end(); it != it_end; ++it)
|
||||
int processed = 0;
|
||||
for (std::map<int, Socket *>::const_iterator it = Sockets.begin(), it_end = Sockets.end(); it != it_end && processed != sresult; ++it)
|
||||
{
|
||||
Socket *s = it->second;
|
||||
|
||||
if (FD_ISSET(s->GetFD(), &efdset) || FD_ISSET(s->GetFD(), &rfdset) || FD_ISSET(s->GetFD(), &wfdset))
|
||||
++processed;
|
||||
if (s->HasFlag(SF_DEAD))
|
||||
continue;
|
||||
if (FD_ISSET(s->GetFD(), &efdset))
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
#include "anope.h"
|
||||
#include "services.h"
|
||||
|
||||
Base::Base()
|
||||
{
|
||||
|
||||
+1
-1
@@ -8,7 +8,7 @@
|
||||
* for use in Anope.
|
||||
*/
|
||||
|
||||
#include "anope.h"
|
||||
#include "services.h"
|
||||
|
||||
/*
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user