* Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
*/
+#include "config.h"
#include "chanserv.h"
#include "conf.h"
#include "common.h"
#include <arpa/inet.h>
#endif
-
#define OPSERV_CONF_NAME "services/opserv"
#define KEY_ALERT_CHANNEL "alert_channel"
{ "OSMSG_WHOIS_CHANNELS", "Channels : %s" },
{ "OSMSG_WHOIS_HIDECHANS", "Channel list omitted for your sanity." },
{ "OSMSG_WHOIS_VERSION", "Version : %s" },
+ { "OSMSG_WHOIS_MARK", "Mark : %s" },
{ "OSMSG_WHOIS_NO_NOTICE", "No_notices : %s" },
{ "OSMSG_UNBAN_DONE", "Ban(s) removed from channel %s." },
{ "OSMSG_CHANNEL_VOICED", "All users on %s voiced." },
typedef struct opservDiscrim {
struct chanNode *channel;
- char *mask_nick, *mask_ident, *mask_host, *mask_info, *mask_version, *server, *reason, *accountmask, *chantarget, *mark;
+ char *mask_nick, *mask_ident, *mask_host, *mask_info, *mask_version, *server, *reason, *accountmask, *chantarget, *mark, *mask_mark;
irc_in_addr_t ip_mask;
unsigned long limit;
time_t min_ts, max_ts;
return; /* channel is invite only */
}
- if (channel->members.used >= channel->limit) {
- return; /* channel is invite on */
+ if (channel->limit > 0) {
+ if (channel->members.used >= channel->limit) {
+ return; /* channel is invite on */
+ }
}
if (*channel->key) {
if(target->version_reply) {
reply("OSMSG_WHOIS_VERSION", target->version_reply);
}
+ if(target->mark) {
+ reply("OSMSG_WHOIS_MARK", target->mark);
+ }
reply("OSMSG_WHOIS_NO_NOTICE", target->no_notice ? "YES":"NO");
if (target->modes) {
reply("OSMSG_ALERTS_BAR");
for (it = dict_first(opserv_user_alerts); it; it = iter_next(it)) {
alert = iter_data(it);
- if(m && (!match_ircglob(alert->text_discrim, m) && strcasecmp(alert->owner, m)) )
+ if(m && (!match_ircglob(alert->text_discrim, m) && strcasecmp(alert->owner, m) && strcasecmp(iter_key(it), m)))
continue; /* not a match to requested filter */
switch (alert->reaction) {
case REACT_NOTICE: reaction = "notice"; break;
if(text[0] == '\001') {
text++;
cmd = mysep(&text, " ");
- if(!irccasecmp(cmd, "VERSION")) {
+ if(cmd && !irccasecmp(cmd, "VERSION")) {
char *version = mysep(&text, "\n");
if(!version)
version = "";
}
discrim->accountmask = argv[++i];
discrim->authed = 1;
+ } else if (irccasecmp(argv[i], "marked") == 0) {
+ discrim->mask_mark = argv[++i];
} else if (irccasecmp(argv[i], "chantarget") == 0) {
if(!IsChannelName(argv[i+1])) {
send_message(user, bot, "MSG_NOT_CHANNEL_NAME");
|| (discrim->info_space == 0 && user->info[0] == ' ')
|| (discrim->info_space == 1 && user->info[0] != ' ')
|| (discrim->server && !match_ircglob(user->uplink->name, discrim->server))
+ || (discrim->mask_mark && (!user->mark || !match_ircglob(user->mark, discrim->mask_mark)))
|| (discrim->accountmask && (!user->handle_info || !match_ircglob(user->handle_info->handle, discrim->accountmask)))
|| (discrim->ip_mask_bits && !irc_check_mask(&user->ip, &discrim->ip_mask, discrim->ip_mask_bits))
)
return 1; /* channel is invite only */
}
- if (channel->members.used >= channel->limit) {
- return 1; /* channel is invite on */
+ if (channel->limit > 0) {
+ if (channel->members.used >= channel->limit) {
+ return 1; /* channel is invite on */
+ }
}
if (*channel->key) {