/*
* ngIRCd -- The Next Generation IRC Daemon
- * Copyright (c)2001-2013 Alexander Barton (alex@barton.de) and Contributors.
+ * Copyright (c)2001-2015 Alexander Barton (alex@barton.de) and Contributors.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* IRC commands
*/
-#include "imp.h"
#include <assert.h>
#include <stdio.h>
#include <string.h>
+#include <strings.h>
+#include <time.h>
#include "ngircd.h"
#include "conn-func.h"
#include "conf.h"
#include "channel.h"
-#include "conn-encoding.h"
-#include "defines.h"
+#ifdef ICONV
+# include "conn-encoding.h"
+#endif
#include "irc-macros.h"
#include "irc-write.h"
#include "log.h"
#include "messages.h"
#include "parse.h"
#include "op.h"
-#include "tool.h"
-#include "exp.h"
#include "irc.h"
static char *Option_String PARAMS((CONN_ID Idx));
assert(Client != NULL);
assert(Req != NULL);
- IRC_SetPenalty(Client, 3);
-
_IRC_GET_SENDER_OR_RETURN_(from, Req, Client)
_IRC_GET_TARGET_SERVER_OR_RETURN_(target, Req, 0, from)
PACKAGE_VERSION, Client_ID(target),
Client_ID(Client_NextHop(target)),
Option_String(idx2),
- time(NULL) - Conn_StartTime(idx2),
+ (long)(time(NULL) - Conn_StartTime(idx2)),
Conn_SendQ(idx), Conn_SendQ(idx2)))
return DISCONNECTED;
assert(Client != NULL);
assert(Req != NULL);
- IRC_SetPenalty(Client, 2);
-
if ((Req->argc == 0 && array_bytes(&Conf_Helptext) > 0)
|| (Req->argc >= 1 && strcasecmp(Req->argv[0], "Commands") != 0)) {
/* Help text available and requested */
IRC_KillClient(CLIENT *Client, CLIENT *From, const char *Nick, const char *Reason)
{
const char *msg;
- CONN_ID my_conn, conn;
+ CONN_ID my_conn = NONE, conn;
CLIENT *c;
+ assert(Nick != NULL);
+ assert(Reason != NULL);
+
/* Do we know such a client in the network? */
c = Client_Search(Nick);
if (!c) {
}
/* Save ID of this connection */
- my_conn = Client_Conn(Client);
+ if (Client)
+ my_conn = Client_Conn(Client);
/* Kill the client NOW:
* - Close the local connection (if there is one),
if (Req->argc > 2) {
if (!SendErrors)
return CONNECTED;
- IRC_SetPenalty(Client, 2);
return IRC_WriteErrClient(Client, ERR_NEEDMOREPARAMS_MSG,
Client_ID(Client), Req->command);
}
- if (Client_Type(Client) == CLIENT_SERVER)
+ if (Client_Type(Client) == CLIENT_SERVER && Req->prefix)
from = Client_Search(Req->prefix);
else
from = Client;