/*
* ngIRCd -- The Next Generation IRC Daemon
- * Copyright (c)2001-2008 Alexander Barton (alex@barton.de)
+ * Copyright (c)2001-2014 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
* Handlers for IRC numerics sent to the server
*/
-#include "imp.h"
#include <assert.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
+#include <time.h>
-#include "defines.h"
-#include "conn.h"
-#include "conf.h"
-#include "conn.h"
#include "conn-func.h"
+#include "conf.h"
#include "channel.h"
#include "class.h"
#include "irc-write.h"
#include "lists.h"
#include "log.h"
-#include "messages.h"
#include "parse.h"
-#include "exp.h"
#include "numeric.h"
-
/**
* Announce a channel and its users in the network.
*/
{
CL2CHAN *cl2chan;
CLIENT *cl;
- char str[LINE_LEN], *ptr;
+ char str[COMMAND_LEN], *ptr;
bool njoin, xop;
/* Check features of remote server */
strlcat(str, ",", sizeof(str));
/* Prepare user prefix (ChanOp, voiced, ...) */
- if (xop && strchr(Channel_UserModes(Chan, cl), 'q'))
+ if (xop && Channel_UserHasMode(Chan, cl, 'q'))
strlcat(str, "~", sizeof(str));
- if (xop && strchr(Channel_UserModes(Chan, cl), 'a'))
+ if (xop && Channel_UserHasMode(Chan, cl, 'a'))
strlcat(str, "&", sizeof(str));
- if (strchr(Channel_UserModes(Chan, cl), 'o'))
+ if (Channel_UserHasMode(Chan, cl, 'o'))
strlcat(str, "@", sizeof(str));
- if (xop && strchr(Channel_UserModes(Chan, cl), 'h'))
+ if (xop && Channel_UserHasMode(Chan, cl, 'h'))
strlcat(str, "%", sizeof(str));
- if (strchr(Channel_UserModes(Chan, cl), 'v'))
+ if (Channel_UserHasMode(Chan, cl, 'v'))
strlcat(str, "+", sizeof(str));
strlcat(str, Client_ID(cl), sizeof(str));
/* Send the data if the buffer is "full" */
- if (strlen(str) > (LINE_LEN - CLIENT_NICK_LEN - 8)) {
+ if (strlen(str) > (sizeof(str) - CLIENT_NICK_LEN - 8)) {
if (!IRC_WriteStrClient(Client, "%s", str))
return DISCONNECTED;
snprintf(str, sizeof(str), "NJOIN %s :",
return CONNECTED;
} /* Announce_Channel */
-
/**
* Announce new server in the network
* @param Client New server
Client_MyToken(Server), Client_Info(Server));
} /* Announce_Server */
-
#ifdef IRCPLUS
/**
return CONNECTED;
}
-
/**
* Send CHANINFO commands to a new server (inform it about existing channels).
* @param Client New server
if (!*modes && !*topic)
return CONNECTED;
- has_k = strchr(modes, 'k') != NULL;
- has_l = strchr(modes, 'l') != NULL;
+ has_k = Channel_HasMode(Chan, 'k');
+ has_l = Channel_HasMode(Chan, 'l');
/* send CHANINFO */
if (!has_k && !has_l) {
#endif /* IRCPLUS */
-
/**
* Handle ENDOFMOTD (376) numeric and login remote server.
* The peer is either an IRC server (no IRC+ protocol), or we got the
return CONNECTED;
} /* IRC_Num_ENDOFMOTD */
-
/**
* Handle ISUPPORT (005) numeric.
*/
return CONNECTED;
} /* IRC_Num_ISUPPORT */
-
/* -eof- */