Skip STATUSMSG prefixes
This feature is rarely used, so just skip STATUSMSG prefixes in the target so messages get routed correctly.master
parent
86a0594cd2
commit
df6bc07f44
1
chat.h
1
chat.h
|
@ -155,6 +155,7 @@ extern struct Network {
|
|||
uint userLen;
|
||||
uint hostLen;
|
||||
char *chanTypes;
|
||||
char *statusmsg;
|
||||
char *prefixes;
|
||||
char *prefixModes;
|
||||
char *listModes;
|
||||
|
|
6
handle.c
6
handle.c
|
@ -270,6 +270,9 @@ static void handleReplyISupport(struct Message *msg) {
|
|||
} else if (!strcmp(key, "CHANTYPES")) {
|
||||
if (!msg->params[i]) continue;
|
||||
set(&network.chanTypes, msg->params[i]);
|
||||
} else if (!strcmp(key, "STATUSMSG")) {
|
||||
if (!msg->params[i]) continue;
|
||||
set(&network.statusmsg, msg->params[i]);
|
||||
} else if (!strcmp(key, "PREFIX")) {
|
||||
strsep(&msg->params[i], "(");
|
||||
char *modes = strsep(&msg->params[i], ")");
|
||||
|
@ -1196,6 +1199,9 @@ static void colorMentions(struct Cat *cat, uint id, struct Message *msg) {
|
|||
|
||||
static void handlePrivmsg(struct Message *msg) {
|
||||
require(msg, true, 2);
|
||||
if (network.statusmsg) {
|
||||
msg->params[0] += strspn(msg->params[0], network.statusmsg);
|
||||
}
|
||||
bool query = !strchr(network.chanTypes, msg->params[0][0]);
|
||||
bool server = strchr(msg->nick, '.');
|
||||
bool mine = !strcmp(msg->nick, self.nick);
|
||||
|
|
Loading…
Reference in New Issue