echo-message should work for clients that aren't in the target channel
Move the echo part to the end of the channel membership loop so that it works even if the user isn't on the channel.
This commit is contained in:
parent
f41f79971c
commit
2d8d5b058b
1 changed files with 29 additions and 2 deletions
31
ircd/send.c
31
ircd/send.c
|
@ -528,7 +528,7 @@ sendto_channel_flags(struct Client *one, int type, struct Client *source_p,
|
||||||
if(!MyClient(source_p) && (IsIOError(target_p->from) || target_p->from == one))
|
if(!MyClient(source_p) && (IsIOError(target_p->from) || target_p->from == one))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
if(MyClient(source_p) && !IsCapable(source_p, CLICAP_ECHO_MESSAGE) && target_p == one)
|
if(MyClient(source_p) && target_p == one)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
if(type && ((msptr->flags & type) == 0))
|
if(type && ((msptr->flags & type) == 0))
|
||||||
|
@ -568,6 +568,25 @@ sendto_channel_flags(struct Client *one, int type, struct Client *source_p,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* source client may not be on the channel, send echo separately */
|
||||||
|
if(MyClient(source_p) && IsCapable(source_p, CLICAP_ECHO_MESSAGE))
|
||||||
|
{
|
||||||
|
target_p = one;
|
||||||
|
|
||||||
|
if (target_p->localClient->caps != current_capmask)
|
||||||
|
{
|
||||||
|
/* reset the linebuf */
|
||||||
|
rb_linebuf_donebuf(&rb_linebuf_local);
|
||||||
|
rb_linebuf_newbuf(&rb_linebuf_local);
|
||||||
|
|
||||||
|
/* render the new linebuf and attach it */
|
||||||
|
linebuf_put_msgbuf(&msgbuf, &rb_linebuf_local, target_p->localClient->caps, "%s", buf);
|
||||||
|
current_capmask = target_p->localClient->caps;
|
||||||
|
}
|
||||||
|
|
||||||
|
_send_linebuf(target_p, &rb_linebuf_local);
|
||||||
|
}
|
||||||
|
|
||||||
rb_linebuf_donebuf(&rb_linebuf_local);
|
rb_linebuf_donebuf(&rb_linebuf_local);
|
||||||
rb_linebuf_donebuf(&rb_linebuf_id);
|
rb_linebuf_donebuf(&rb_linebuf_id);
|
||||||
}
|
}
|
||||||
|
@ -628,7 +647,7 @@ sendto_channel_opmod(struct Client *one, struct Client *source_p,
|
||||||
if(!MyClient(source_p) && (IsIOError(target_p->from) || target_p->from == one))
|
if(!MyClient(source_p) && (IsIOError(target_p->from) || target_p->from == one))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
if(MyClient(source_p) && !IsCapable(source_p, CLICAP_ECHO_MESSAGE) && target_p == one)
|
if(MyClient(source_p) && target_p == one)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
if((msptr->flags & CHFL_CHANOP) == 0)
|
if((msptr->flags & CHFL_CHANOP) == 0)
|
||||||
|
@ -658,6 +677,14 @@ sendto_channel_opmod(struct Client *one, struct Client *source_p,
|
||||||
_send_linebuf(target_p, &rb_linebuf_local);
|
_send_linebuf(target_p, &rb_linebuf_local);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* source client may not be on the channel, send echo separately */
|
||||||
|
if(MyClient(source_p) && IsCapable(source_p, CLICAP_ECHO_MESSAGE))
|
||||||
|
{
|
||||||
|
target_p = one;
|
||||||
|
|
||||||
|
_send_linebuf(target_p, &rb_linebuf_local);
|
||||||
|
}
|
||||||
|
|
||||||
rb_linebuf_donebuf(&rb_linebuf_local);
|
rb_linebuf_donebuf(&rb_linebuf_local);
|
||||||
rb_linebuf_donebuf(&rb_linebuf_old);
|
rb_linebuf_donebuf(&rb_linebuf_old);
|
||||||
rb_linebuf_donebuf(&rb_linebuf_new);
|
rb_linebuf_donebuf(&rb_linebuf_new);
|
||||||
|
|
Loading…
Reference in a new issue