extern unsigned int CLICAP_USERHOST_IN_NAMES;
extern unsigned int CLICAP_CAP_NOTIFY;
extern unsigned int CLICAP_CHGHOST;
+extern unsigned int CLICAP_ECHO_MESSAGE;
/*
* XXX: this is kind of ugly, but this allows us to have backwards
unsigned int CLICAP_USERHOST_IN_NAMES;
unsigned int CLICAP_CAP_NOTIFY;
unsigned int CLICAP_CHGHOST;
+unsigned int CLICAP_ECHO_MESSAGE;
/*
* initialize our builtin capability table. --nenolod
CLICAP_USERHOST_IN_NAMES = capability_put(cli_capindex, "userhost-in-names", NULL);
CLICAP_CAP_NOTIFY = capability_put(cli_capindex, "cap-notify", NULL);
CLICAP_CHGHOST = capability_put(cli_capindex, "chghost", NULL);
+ CLICAP_ECHO_MESSAGE = capability_put(cli_capindex, "echo-message", NULL);
}
static CNCB serv_connect_callback;
msptr = ptr->data;
target_p = msptr->client_p;
- if(IsIOError(target_p->from) || target_p->from == one)
+ if(!MyClient(source_p) && (IsIOError(target_p->from) || target_p->from == one))
+ continue;
+
+ if(MyClient(source_p) && !IsCapable(source_p, CLICAP_ECHO_MESSAGE) && target_p == one)
continue;
if(type && ((msptr->flags & type) == 0))
msptr = ptr->data;
target_p = msptr->client_p;
- if(IsIOError(target_p->from) || target_p->from == one)
+ if(!MyClient(source_p) && (IsIOError(target_p->from) || target_p->from == one))
+ continue;
+
+ if(MyClient(source_p) && !IsCapable(source_p, CLICAP_ECHO_MESSAGE) && target_p == one)
continue;
if((msptr->flags & CHFL_CHANOP) == 0)