message: run privmsg_user hook on both source and target
This commit is contained in:
parent
4abf8eb2e6
commit
92f5320e1d
1 changed files with 14 additions and 14 deletions
|
@ -765,22 +765,22 @@ msg_client(enum message_type msgtype,
|
||||||
sendto_one_numeric(source_p, RPL_AWAY, form_str(RPL_AWAY),
|
sendto_one_numeric(source_p, RPL_AWAY, form_str(RPL_AWAY),
|
||||||
target_p->name, target_p->user->away);
|
target_p->name, target_p->user->away);
|
||||||
|
|
||||||
|
hdata.msgtype = msgtype;
|
||||||
|
hdata.source_p = source_p;
|
||||||
|
hdata.target_p = target_p;
|
||||||
|
hdata.text = text;
|
||||||
|
hdata.approved = 0;
|
||||||
|
|
||||||
|
call_hook(h_privmsg_user, &hdata);
|
||||||
|
|
||||||
|
/* buffer location may have changed. */
|
||||||
|
text = hdata.text;
|
||||||
|
|
||||||
|
if (hdata.approved != 0)
|
||||||
|
return;
|
||||||
|
|
||||||
if(MyClient(target_p))
|
if(MyClient(target_p))
|
||||||
{
|
{
|
||||||
hdata.msgtype = msgtype;
|
|
||||||
hdata.source_p = source_p;
|
|
||||||
hdata.target_p = target_p;
|
|
||||||
hdata.text = text;
|
|
||||||
hdata.approved = 0;
|
|
||||||
|
|
||||||
call_hook(h_privmsg_user, &hdata);
|
|
||||||
|
|
||||||
/* buffer location may have changed. */
|
|
||||||
text = hdata.text;
|
|
||||||
|
|
||||||
if (hdata.approved != 0)
|
|
||||||
return;
|
|
||||||
|
|
||||||
if (EmptyString(text))
|
if (EmptyString(text))
|
||||||
{
|
{
|
||||||
/* could be empty after colour stripping and
|
/* could be empty after colour stripping and
|
||||||
|
|
Loading…
Reference in a new issue