From 027aab3f8d1977ac831f33abe4486a30ca224dbf Mon Sep 17 00:00:00 2001 From: =?utf8?q?Wilfried=20G=C3=B6esgens?= Date: Tue, 14 Jul 2009 21:54:25 +0000 Subject: [PATCH] * notify about the actual message number, not the queue message ID --- citadel/modules/extnotify/extnotify_main.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/citadel/modules/extnotify/extnotify_main.c b/citadel/modules/extnotify/extnotify_main.c index 0f85dfc77..e06c07e18 100644 --- a/citadel/modules/extnotify/extnotify_main.c +++ b/citadel/modules/extnotify/extnotify_main.c @@ -161,8 +161,9 @@ void do_extnotify_queue(void) { /*! * \brief Process messages in the external notification queue */ -void process_notify(long msgnum, void *usrdata) +void process_notify(long NotifyMsgnum, void *usrdata) { + long msgnum; long todelete[1]; int fnblAllowed; int extPagerAllowedHttp; @@ -175,7 +176,7 @@ void process_notify(long msgnum, void *usrdata) NotifyHostList = (StrBuf**) usrdata; - msg = CtdlFetchMessage(msgnum, 1); + msg = CtdlFetchMessage(NotifyMsgnum, 1); if ( msg->cm_fields['W'] == NULL) { goto nuke; } @@ -205,7 +206,9 @@ void process_notify(long msgnum, void *usrdata) fnblAllowed = strncasecmp(configMsg, HKEY(FUNAMBOL_CONFIG_TEXT)); extPagerAllowedHttp = strncasecmp(configMsg, HKEY(PAGER_CONFIG_HTTP)); extPagerAllowedSystem = strncasecmp(configMsg, HKEY(PAGER_CONFIG_SYSTEM)); - + pch = strstr(msg->cm_fields['M'], "msgid|"); + if (pch != NULL) + msgnum = atol(pch + sizeof("msgid")); if (fnblAllowed == 0) { char remoteurl[SIZ]; snprintf(remoteurl, SIZ, "http://%s@%s:%d/%s", @@ -267,7 +270,7 @@ void process_notify(long msgnum, void *usrdata) nuke: CtdlFreeMessage(msg); memset(configMsg, 0, sizeof(configMsg)); - todelete[0] = msgnum; + todelete[0] = NotifyMsgnum; CtdlDeleteMessages(FNBL_QUEUE_ROOM, todelete, 1, ""); } -- 2.30.2