From a185665be4cf699752589d81ef6e396dd61f68b6 Mon Sep 17 00:00:00 2001 From: Rainer Gerhards Date: Fri, 19 Dec 2008 12:52:49 +0100 Subject: experimentally altered "last message repeated n times" to include msg This was suggested by David Lang, to help identify the message that was repeated. A problem is that I do not have the expanded template at hand when the "last ... times" message is generated. Spending much time on this functionality is also probably not a good thing, as the whole functionality will be overhauled (and once this is done we will not at all have the output template at hand). So the approach is to use a single field - here msg - and inlcude it as a notation of what was repeated. This is far from being perfect, but eventually good enough. I will now wait for feedback before going any further. --- action.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/action.c b/action.c index dee46f16..ab4d2f4d 100644 --- a/action.c +++ b/action.c @@ -621,9 +621,15 @@ actionWriteToAction(action_t *pAction) */ if(pAction->f_prevcount > 1) { msg_t *pMsg; +#if 0 /* old */ uchar szRepMsg[64]; snprintf((char*)szRepMsg, sizeof(szRepMsg), "last message repeated %d times", pAction->f_prevcount); +#else + uchar szRepMsg[1024]; + snprintf((char*)szRepMsg, sizeof(szRepMsg), "message repeated %d times: [%.800]", + pAction->f_prevcount, getMSG(pAction->f_pMsg)); +#endif if((pMsg = MsgDup(pAction->f_pMsg)) == NULL) { /* it failed - nothing we can do against it... */ @@ -658,12 +664,11 @@ actionWriteToAction(action_t *pAction) dbgprintf("action not yet ready again to be executed, onceInterval %d, tCurr %d, tNext %d\n", (int) pAction->iSecsExecOnceInterval, (int) getActNow(pAction), (int) (pAction->iSecsExecOnceInterval + pAction->tLastExec)); - /* TODO: the time call below may use reception time, not dequeue time - under consideration. -- rgerhards, 2008-09-17 */ pAction->tLastExec = getActNow(pAction); /* re-init time flags */ FINALIZE; } - /* TODO: the time call below may use reception time, not dequeue time - under consideration. -- rgerhards, 2008-09-17 */ + /* we use reception time, not dequeue time - this is considered more appropriate and also faster ;) -- rgerhards, 2008-09-17 */ pAction->f_time = pAction->f_pMsg->ttGenTime; /* When we reach this point, we have a valid, non-disabled action. -- cgit v1.2.3