From: pk910 Date: Tue, 28 Jun 2011 13:39:27 +0000 (+0200) Subject: Reset idle time only if the message is non-empty, not the same as the previous messag... X-Git-Tag: WGN5~59 X-Git-Url: http://git.pk910.de/?p=ircu2.10.12-pk.git;a=commitdiff_plain;h=db85b2223cc105a28c256769e373651a3cf6e756 Reset idle time only if the message is non-empty, not the same as the previous message and the destination is valid. --- diff --git a/ircd/m_privmsg.c b/ircd/m_privmsg.c index c2b09ae..e5edee2 100644 --- a/ircd/m_privmsg.c +++ b/ircd/m_privmsg.c @@ -115,15 +115,15 @@ int m_privmsg(struct Client* cptr, struct Client* sptr, int parc, char* parv[]) ClrFlag(sptr, FLAG_TS8); - if (feature_bool(FEAT_IDLE_FROM_MSG)) - cli_user(sptr)->last = CurrentTime; - if (parc < 2 || EmptyString(parv[1])) return send_reply(sptr, ERR_NORECIPIENT, MSG_PRIVATE); if (parc < 3 || EmptyString(parv[parc - 1])) return send_reply(sptr, ERR_NOTEXTTOSEND); + if (feature_bool(FEAT_IDLE_FROM_MSG) && (!cli_user(sptr)->lastmsg || strcmp(cli_user(sptr)->lastmsg, parv[parc - 1]))) + cli_user(sptr)->last = CurrentTime; + count = unique_name_vector(parv[1], ',', vector, MAXTARGETS); ccount = 0; @@ -211,15 +211,15 @@ int mo_privmsg(struct Client* cptr, struct Client* sptr, int parc, char* parv[]) ClrFlag(sptr, FLAG_TS8); - if (feature_bool(FEAT_IDLE_FROM_MSG)) - cli_user(sptr)->last = CurrentTime; - if (parc < 2 || EmptyString(parv[1])) return send_reply(sptr, ERR_NORECIPIENT, MSG_PRIVATE); if (parc < 3 || EmptyString(parv[parc - 1])) return send_reply(sptr, ERR_NOTEXTTOSEND); + if (feature_bool(FEAT_IDLE_FROM_MSG) && && (!cli_user(sptr)->lastmsg || strcmp(cli_user(sptr)->lastmsg, parv[parc - 1]))) + cli_user(sptr)->last = CurrentTime; + count = unique_name_vector(parv[1], ',', vector, MAXTARGETS); for (i = 0; i < count; ++i) {