From db85b2223cc105a28c256769e373651a3cf6e756 Mon Sep 17 00:00:00 2001 From: pk910 Date: Tue, 28 Jun 2011 15:39:27 +0200 Subject: [PATCH] Reset idle time only if the message is non-empty, not the same as the previous message and the destination is valid. --- ircd/m_privmsg.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) 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) { -- 2.20.1