-/* Copyright (C) 2009-2011, Martin Johansson <martin@fatbob.nu>
- Copyright (C) 2005-2011, Thorvald Natvig <thorvald@natvig.com>
+/* Copyright (C) 2009-2012, Martin Johansson <martin@fatbob.nu>
+ Copyright (C) 2005-2012, Thorvald Natvig <thorvald@natvig.com>
All rights reserved.
#include "channel.h"
#include "version.h"
#include "voicetarget.h"
+#include "ban.h"
extern char system_string[], version_string[];
Client_free(c);
}
}
+ Ban_pruneBanned();
}
void Client_codec_add(client_t *client, int codec)
{
client_t *newclient;
message_t *sendmsg;
-
+
+ if (Ban_isBannedAddr((in_addr_t *)&remote->sin_addr)) {
+ Log_info("Address %s banned. Disconnecting", inet_ntoa(remote->sin_addr));
+ return -1;
+ }
newclient = malloc(sizeof(client_t));
if (newclient == NULL)
Log_fatal("Out of memory");
static inline void Client_send_voice(client_t *src, client_t *dst, uint8_t *data, int len, int poslen)
{
- if (IS_AUTH(dst) && dst != src && !dst->deaf) {
+ if (IS_AUTH(dst) && dst != src && (!dst->deaf || !dst->self_deaf)) {
if (poslen > 0 && /* Has positional data */
src->context != NULL && dst->context != NULL && /* ...both source and destination has context */
strcmp(src->context, dst->context) == 0) /* ...and the contexts match */