49 |
#include "hash.h" |
#include "hash.h" |
50 |
#include "email.h" |
#include "email.h" |
51 |
#include "log.h" |
#include "log.h" |
|
#include "sipc.h" |
|
52 |
#include "timestr.h" |
#include "timestr.h" |
53 |
|
|
54 |
/*******************************************************************/ |
/*******************************************************************/ |
99 |
|
|
100 |
/*****************************************************************************/ |
/*****************************************************************************/ |
101 |
|
|
|
int IpcConnectType::sendAkills(int akillType, const char *searchText) |
|
|
{ |
|
|
struct akill *ak; |
|
|
char mask[NICKLEN + USERLEN + HOSTLEN + 3]; |
|
|
char length[16]; |
|
|
int x = 0; |
|
|
|
|
|
if (!firstBanItem) |
|
|
return 0; |
|
|
|
|
|
for (ak = firstBanItem; ak; ak = ak->next) { |
|
|
if (ak->type == akillType || ak->type == 0) { |
|
|
strcpy(mask, ak->nick); |
|
|
strcat(mask, "!"); |
|
|
strcat(mask, ak->user); |
|
|
strcat(mask, "@"); |
|
|
strcat(mask, ak->host); |
|
|
|
|
|
if (searchText && strcmp(mask, searchText) ) |
|
|
continue; |
|
|
|
|
|
if (ak->unset) |
|
|
sprintf(length, "%luh", |
|
|
(long)(ak->unset - ak->set) / 3600); |
|
|
else |
|
|
strcpy(length, "forever"); |
|
|
|
|
|
fWriteLn("DATA %ld %ld %s %s :%s", ak->set, ak->unset, length, mask, ak->reason); |
|
|
x++; |
|
|
} |
|
|
} |
|
|
return x; |
|
|
} |
|
|
|
|
102 |
/** |
/** |
103 |
* \brief Excluded the given nick from akill mailings to ops@ and kline@ |
* \brief Excluded the given nick from akill mailings to ops@ and kline@ |
104 |
* \param nick -- The setter to be excluded, non-null zero terminated char array |
* \param nick -- The setter to be excluded, non-null zero terminated char array |